1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-02 03:28:25 +08:00

fix(blockservice) test

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
Brian Tiger Chow
2014-11-23 18:27:02 -08:00
committed by Jeromy
parent 07bb901ed5
commit aac3c6abbd

View File

@ -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 {