fix(blockservice) test
License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
Brian Tiger Chow committed
Nov 23, 2014 at 18:27 UTC
aac3c6abbd6fc700f4a305ab56bccd15ac5ed4f0
1 file changed
+6
-1
blockservice/blocks_test.go
+6
-1
@@ -87,9 +87,14 @@ func TestGetBlocks(t *testing.T) {
87
servs[0].AddBlock(blk)
88
}
89
90
+ var chans []<-chan *blocks.Block
91
for i := 1; i < 4; i++ {
92
ctx, _ := context.WithTimeout(context.TODO(), time.Second*5)
92
- out := servs[i].GetBlocks(ctx, keys)
93
+ ch := servs[i].GetBlocks(ctx, keys)
94
+ chans = append(chans, ch)
95
+ }
96
+
97
+ for _, out := range chans {
98
gotten := make(map[u.Key]*blocks.Block)
99
for blk := range out {
100
if _, ok := gotten[blk.Key()]; ok {