Repository navigation
test(desktop): hold a join's answers apart from the window's loop - #197
Merged
Merged
Conversation
TestAnOldJoinCannotFinishTheNewRun swapped the whole window's loop for a held one, so an answer of a call still in flight from the start could be taken for the join's. On one starved CPU it failed 94 times in 100, and it failed #188's CI. The join flow posts to its own hook when it has one, and the test holds only the join's answers: 100 in 100 pass there.
frostyard-machines
approved these changes
Nov 11, 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.
Summary
TestAnOldJoinCannotFinishTheNewRun(from 9b369da) is flaky. It failed #188's CI (run 43057093200) withcurrent error not shown, and it fails 94 times in 100 when pinned to one CPU shared with three busy loops.Cause: the test swapped the whole window's event loop for a held channel. The answers of
a.calls still in flight from the window's start, such as a second vault list after the connection, also landed on that channel. On a slow runner one arrived first, the test took it for the old join's answer, and the real old answer then failed the check.Fix:
joinFlowgets aposthook, which is the window's loop when nil. The test sets it, so it holds only the join's answers. Pinned the same way, the test now passes 100 times in 100. It still fails ("old answer replaced the new join") if the run-ID check injoinFlow.startis removed.Production behavior is unchanged. This doesn't touch #194, which is a different problem in the same flow.
Risk tier
Risk tier: 1 — a test and a test seam. No changed path matches the repository's L1 or L2 globs.
Verification
make checkgreen (host)go test -race ./internal/desktop/window/greenmake desktop-buildgreenjoinFlow.start, the test fails