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 {