Repository navigation
test(desktop-linux): allow explained Xvfb retries in display race test - #247
Merged
Merged
Conversation
Stale or foreign X locks on a reserved display make the fake server fail, and startXvfb correctly retries the next display. Assert one claim per allocated display instead of an exact spawn count. Closes #240
The fake Xvfb now writes one event log. It records spawn, claim and fail lines, and an overlap line when another fake from the test is alive on the same display. The claim line lands before the socket can be seen, and fail lines land before the fake exits, so the log is complete once every worker reports. The race test fails on any overlap or unsettled spawn and when the claimed displays differ from the allocated ones. Retries caused by a stale or foreign lock or socket still pass. Failure messages include the worker results and the event log. Refs #240
This was referenced Oct 5, 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.
The allocator retries by design. When an Xvfb attempt fails with confirmed cleanup,
startXvfbmoves to the next display. A stale lock or socket file passesreserveFreeDisplay, and the test's fake Xvfb exits on it. A foreign server can also take a display after the check. Both cases give a valid extra spawn. The race test asserted exactly 12 spawns, so it failed on correct retry behavior.The fake Xvfb now logs each display it actually claims. The test checks that the claims equal the 12 allocated displays exactly. That means one claim per display, no duplicate claim, and no retry that leaked a claimed server. Spawns must be at least 12, and every claim must appear in the spawn log. So every extra spawn is a failed attempt that never claimed a display. Product code is unchanged.
QA pass skipped: this change is test-only and has no user-facing behavior.
bun run test:coverage--base origin/mainCloses #240