Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the count be equal between the nodes?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they should. This is just the wait loop in order to validate the exact bins later in this test.

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