Repository navigation
fix(desktop): start Xvfb with -noreset so overlapping clients survive - #204
Merged
Merged
Conversation
Without -noreset Xvfb resets when its last running client disconnects and closes every client still in its connection handshake. Two overlapping short-lived clients, such as a window wait's xdotool and execApp's first xdotool, then fail with "Can't open display" (#201).
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.
Closes #201
The CI failure was not a slow window. The stack points at
execApp's firstlistWindows(apps.ts:259), which runs before zenity is started, while the concurrentdesktopWaitwindow wait did not reject and polled for its full 8 s. That accounts for the 9.17 s. So the display was alive, and one xdotool connection was refused.Cause: session Xvfb ran without
-noreset. Xvfb then regenerates whenever its last running client disconnects, and the reset closes every client still in its connection handshake. When the window wait's xdotool exits whileexecApp's xdotool is mid-handshake, the second one fails with a bare "Can't open display". A connected, not yet set-up client is killed by a reset every time; the race is just how often that timing comes up, which load makes more likely.Local evidence: Xvfb regenerated 150 times in 150 client bursts without the flag and once with it. A raw socket held mid-handshake across one xdotool run gets a broken pipe without
-noresetand a successful setup reply with it.Change:
buildXvfbArgsadds-noreset; it is the only Xvfb spawn site, so desktop and browser sessions both get it. Nothing in the code depends on server resets. A new live test inintegration.test.tsholds a connection mid-handshake across a short-lived xdotool client and expects a successful setup reply. It fails in under a second with the flag removed and passes with it.On the issue checklist: the 8 s window budget did not cause this failure, so it is unchanged, and no retries or skips were added. Capturing the Xvfb log in this test is no longer needed to tell the two candidates apart.
Verification in a worktree at 80cb7de: lint, typecheck, build and PickCheck pass. Full
bun run testandbun run test:coverageeach had one unrelated failure (core/test/containment.test.ts"kernel thread" in one run,android/test/emulator.test.tsAVD lock in the other). Another test suite was running on the same host at the time, and each of those tests passes 3 of 3 when run alone on both this branch and main.