From 0f12f4b2453989fb0eb3142e7aaac4b185dade26 Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet Date: Wed, 10 Dec 2014 21:03:15 -0800 Subject: [PATCH] shorter peer queue test --- peer/queue/queue_test.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/peer/queue/queue_test.go b/peer/queue/queue_test.go index 7cc177ad0..bd997adf6 100644 --- a/peer/queue/queue_test.go +++ b/peer/queue/queue_test.go @@ -74,7 +74,15 @@ func newPeerTime(t time.Time) peer.Peer { } func TestSyncQueue(t *testing.T) { + tickT := time.Microsecond * 100 + max := 10000 + consumerN := 10 + countsIn := make([]int, consumerN*2) + countsOut := make([]int, consumerN) + if testing.Short() { + tickT = time.Microsecond * 50 + max = 1000 t.SkipNow() } ctx := context.Background() @@ -83,15 +91,10 @@ func TestSyncQueue(t *testing.T) { cq := NewChanQueue(ctx, pq) wg := sync.WaitGroup{} - max := 10000 - consumerN := 10 - countsIn := make([]int, consumerN*2) - countsOut := make([]int, consumerN) - produce := func(p int) { defer wg.Done() - tick := time.Tick(time.Microsecond * 100) + tick := time.Tick(tickT) for i := 0; i < max; i++ { select { case tim := <-tick: