Skip to content
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
15 changes: 9 additions & 6 deletions ledger/catchpointtracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1092,16 +1092,19 @@ func TestCatchpointTrackerWaitNotBlocking(t *testing.T) {
}

// switch context one more time to give the blockqueue syncer to run
time.Sleep(1 * time.Millisecond)
time.Sleep(10 * time.Millisecond)

// ensure Ledger.Wait() is non-blocked for all rounds except the last one (due to possible races)
for rnd := startRound; rnd < endRound; rnd++ {
done := ledger.Wait(rnd)
select {
case <-done:
default:
require.FailNow(t, fmt.Sprintf("Wait(%d) is blocked", rnd))
}
require.Eventually(t, func() bool {
select {
case <-done:
return true
default:
return false
}
}, 15*time.Millisecond, 1*time.Millisecond, "Wait(%d) is blocked", rnd)
}
}

Expand Down
Loading