Repository navigation
test(tui): wait for the stuck request to be accepted before stopping - #5437
Merged
Merged
Conversation
TestStopGivesUpOnAStuckRequestAtItsBudget failed on macOS -race when Stop ran before the server had accepted the half-written request: with nothing tracked, Shutdown returned nil at once. Answering a later /status request first proves the earlier connection was accepted.
Contributor
|
Verdict: Approve This fixes a flaky macOS TUI test: before, it could call Stop before the server had picked up the half-sent request, so Stop returned right away and the test failed. Now the test sends one ordinary request and waits for the reply before calling Stop, which proves the stuck request was already picked up. The reasoning holds and the change touches only the test. Real-world evidenceN/A: this is a test-only change, so no evidence bundle was produced. I ran the changed test here with the race detector, 20 times in a row ( 🔍 Technical detailsWhy the fix is sound
Issues found: none. Strengths
|
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.
The macOS TUI test job fails intermittently on
TestStopGivesUpOnAStuckRequestAtItsBudget(twice on #5148 today), which blocks unrelated PRs. The test could call Stop before the control server had even accepted its half-written request, so Stop found nothing in flight and returned success at once. The test now waits for a later/statusrequest to be answered first, which proves the earlier connection was accepted.Test plan
go test ./internal/control/ -run TestStopGivesUpOnAStuckRequestAtItsBudget -count=30passesgo test ./internal/control/passes