fix: use AwaitAssert for eventually-consistent cluster state in QuickRestartSpec#8183
Merged
Aaronontheweb merged 3 commits intoApr 24, 2026
Conversation
…RestartSpec The bare assertions at lines 128-130 checked cluster membership and unreachable state without polling for convergence. After a random sleep (0-14s), gossip may not have fully propagated, leaving stale Unreachable entries. The identical checks 15 lines earlier already used Within(20s, AwaitAssert(...)) — this brings the post-sleep assertions in line with that pattern. Cluster state is eventually consistent by design; bare assertions on it are a test bug, not a framework issue.
…Delay - All methods now return Task and use WithinAsync/AwaitAssertAsync/RunOnAsync - Thread.Sleep replaced with await Task.Delay for the gating delay - Terminate().Wait() replaced with await Terminate().WaitAsync() - Removed unused System.Threading using
4 tasks
Aaronontheweb
added a commit
that referenced
this pull request
Apr 24, 2026
…RestartSpec (#8183) * fix: use AwaitAssert for eventually-consistent cluster state in QuickRestartSpec The bare assertions at lines 128-130 checked cluster membership and unreachable state without polling for convergence. After a random sleep (0-14s), gossip may not have fully propagated, leaving stale Unreachable entries. The identical checks 15 lines earlier already used Within(20s, AwaitAssert(...)) — this brings the post-sleep assertions in line with that pattern. Cluster state is eventually consistent by design; bare assertions on it are a test bug, not a framework issue. * Convert QuickRestartSpec to async and replace Thread.Sleep with Task.Delay - All methods now return Task and use WithinAsync/AwaitAssertAsync/RunOnAsync - Thread.Sleep replaced with await Task.Delay for the gating delay - Terminate().Wait() replaced with await Terminate().WaitAsync() - Removed unused System.Threading using
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
QuickRestartSpec.JoinAndRestart()withWithin(20s, AwaitAssert(...))to properly poll for gossip convergenceRoot Cause
After a random 0–14s sleep between rounds, the test asserted
Unreachable.Count.ShouldBe(0)without polling. Cluster state is eventually consistent — gossip may not have fully propagated after the sleep, leaving staleUnreachableentries. This caused intermittent failures on CI (observed in build #126246, PR #8181).Test plan