Conversation
…elsEntireZoneImmediatelyOnSingleFailure flakyness Signed-off-by: Marco Pracucci <[email protected]>
monoxane
approved these changes
Apr 2, 2026
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.
What this PR does:
I've seen
TestDoUntilQuorumWithoutSuccessfulContextCancellation_CancelsEntireZoneImmediatelyOnSingleFailurehanging in CI until the 30m tests timeout expires:Details
Why?
There were two bugs in the test, both related to the
f()callback running inside goroutines spawned byDoUntilQuorumWithoutSuccessfulContextCancellation:MinimizeRequests: true, the test relies on the failing zone's replica-2 enteringf()and closing a synchronization channel when its context is cancelled. However, there was no guarantee that replica-2's goroutine would reachawaitStartbefore replica-1's error was processed by the main loop. When replica-1's error was processed first,cancelContextForcancelled all zone contexts — including replica-2's. If replica-2's goroutine then reachedawaitStartwith bothctx.Done()and the zone release channel ready, Go'sselectcould randomly pickctx.Done(), causing the goroutine to return early without ever callingf(). The synchronization channel was never closed, and all other goroutines blocked waiting for it.require.FailNowin non-test goroutines (secondary): The timeout branches calledrequire.FailNow, which invokesruntime.Goexit(). When called from a goroutine spawned byDoUntilQuorumWithoutSuccessfulContextCancellation(not the test goroutine), this terminated the goroutine without sending its result to the internal results channel. The main loop then hung forever waiting for results that would never arrive.The fix:
sync.WaitGroupso that replica-1 waits for replica-2 to enterf()before returning its error. This guarantees both goroutines have passedawaitStartbefore the error triggers context cancellation, eliminating the race.require.FailNowcalls with returning errors fromf(). These errors are still caught by the test: the replica-2 timeout is caught byrequire.True(t, failingZoneSawCancelledContext), and the default case timeout causes a second zone failure which is caught byrequire.NoError(t, err).Which issue(s) this PR fixes:
N/A
Checklist