Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Commit

Permalink
network/stream: more resilient TestNodesCorrectBinsDynamic (#1776)
Browse files Browse the repository at this point in the history
  • Loading branch information
janos committed Sep 19, 2019
1 parent 4137999 commit fd34ea6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion network/stream/v2/cursors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,19 @@ func TestNodesCorrectBinsDynamic(t *testing.T) {
}

// wait for the nodes to exchange StreamInfo messages
time.Sleep(100 * time.Millisecond)
wantCursorsCount := 17
for i := 499; i >= 0; i-- { // wait time 5s
time.Sleep(10 * time.Millisecond)
count1 := nodeRegistry(sim, nodeIDs[0]).getPeer(nodeIDs[1]).cursorsCount()
count2 := nodeRegistry(sim, nodeIDs[1]).getPeer(nodeIDs[0]).cursorsCount()
if count1 >= wantCursorsCount && count2 >= wantCursorsCount {
break
}
if i == 0 {
return fmt.Errorf("got cursors %v and %v, want %v", count1, count2, wantCursorsCount)
}
}

idPivot := nodeIDs[0]
pivotSyncer := nodeRegistry(sim, idPivot)
pivotKademlia := nodeKademlia(sim, idPivot)
Expand Down

0 comments on commit fd34ea6

Please sign in to comment.