From aac3c6abbd6fc700f4a305ab56bccd15ac5ed4f0 Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Sun, 23 Nov 2014 18:27:02 -0800 Subject: [PATCH] fix(blockservice) test License: MIT Signed-off-by: Brian Tiger Chow --- blockservice/blocks_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/blockservice/blocks_test.go b/blockservice/blocks_test.go index fd4ac34c3..d9b2facb1 100644 --- a/blockservice/blocks_test.go +++ b/blockservice/blocks_test.go @@ -87,9 +87,14 @@ func TestGetBlocks(t *testing.T) { servs[0].AddBlock(blk) } + var chans []<-chan *blocks.Block for i := 1; i < 4; i++ { ctx, _ := context.WithTimeout(context.TODO(), time.Second*5) - out := servs[i].GetBlocks(ctx, keys) + ch := servs[i].GetBlocks(ctx, keys) + chans = append(chans, ch) + } + + for _, out := range chans { gotten := make(map[u.Key]*blocks.Block) for blk := range out { if _, ok := gotten[blk.Key()]; ok {