From b766792d82d9f6f6f74743e8e01ff0aebd9d5558 Mon Sep 17 00:00:00 2001 From: tidwall Date: Tue, 14 Aug 2018 11:08:34 -0700 Subject: [PATCH] Fix expire test --- pkg/expire/expire_test.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/pkg/expire/expire_test.go b/pkg/expire/expire_test.go index 0bbc2c17..1707b45b 100644 --- a/pkg/expire/expire_test.go +++ b/pkg/expire/expire_test.go @@ -38,23 +38,13 @@ func TestBasic(t *testing.T) { } func TestRandomQueue(t *testing.T) { - N := 100000 + N := 1000 now := time.Now() var list List for i := 0; i < N; i++ { list.Push(&testItem{fmt.Sprintf("%d", i), now.Add(time.Duration(rand.Float64() * float64(time.Second)))}) } - // var wg sync.WaitGroup - // wg.Add(N) - // var items []Item - // list.Expired = func(item Item) { - // items = append(items, item) - // wg.Done() - // } - - // wg.Wait() - var items []Item for list.queue.len > 0 { n1 := list.queue.peek() @@ -77,7 +67,7 @@ func TestRandomQueue(t *testing.T) { } func TestExpires(t *testing.T) { - N := 100000 + N := 1000 now := time.Now() var list List for i := 0; i < N; i++ {