Commit 10090dc7 authored by Brian Tiger Chow's avatar Brian Tiger Chow Committed by Jeromy

fix(blockservice) test

License: MIT
Signed-off-by: default avatarBrian Tiger Chow <brian@perfmode.com>
parent 0f5ebd5c
...@@ -87,9 +87,14 @@ func TestGetBlocks(t *testing.T) { ...@@ -87,9 +87,14 @@ func TestGetBlocks(t *testing.T) {
servs[0].AddBlock(blk) servs[0].AddBlock(blk)
} }
var chans []<-chan *blocks.Block
for i := 1; i < 4; i++ { for i := 1; i < 4; i++ {
ctx, _ := context.WithTimeout(context.TODO(), time.Second*5) 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) gotten := make(map[u.Key]*blocks.Block)
for blk := range out { for blk := range out {
if _, ok := gotten[blk.Key()]; ok { if _, ok := gotten[blk.Key()]; ok {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment