Repository navigation
fix(computers): a restarted desktop clears the X lock a killed X left - #411
Open
earakely-scale wants to merge 1 commit into
Open
earakely-scale wants to merge 1 commit into
earakely-scale wants to merge 1 commit into
Conversation
docker restart keeps the container's files, so an X killed before it removed /tmp/.X99-lock leaves it behind. Pids start again from 1, so the pid it names is often taken; X then refuses to start and supervisord gives up on it, while the driver keeps answering not ready. start-desktop now removes the lock before starting X, since supervisord runs one X at a time. A base test plants a lock naming pid 1 and hard-restarts; the restart chaos test's timeout names the checks that failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment on lines
+98
to
101
| assert all(" RUNNING " in line for line in running.splitlines()), running | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("setting, value, error", [ |
There was a problem hiding this comment.
Failed startup passes the test
The new test passes if _all_running(name) returns an empty string after the restart. That helper returns the last command's output even when every attempt fails, and all(...) over empty output is true. Assert that running is nonempty before checking its lines so a desktop that never starts cannot pass this regression test.
Suggested change
| assert all(" RUNNING " in line for line in running.splitlines()), running | |
| @pytest.mark.parametrize("setting, value, error", [ | |
| assert running and all(" RUNNING " in line for line in running.splitlines()), running | |
| @pytest.mark.parametrize("setting, value, error", [ |
Prompt To Fix With AI
This is a comment left during a code review.
Path: tst/integration/computer/base_computer_test.py
Line: 98-101
Comment:
**Failed startup passes the test**
The new test passes if `_all_running(name)` returns an empty string after the restart. That helper returns the last command's output even when every attempt fails, and `all(...)` over empty output is true. Assert that `running` is nonempty before checking its lines so a desktop that never starts cannot pass this regression test.
```suggestion
assert running and all(" RUNNING " in line for line in running.splitlines()), running
@pytest.mark.parametrize("setting, value, error", [
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.This branch has not been deployed
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.
recording_chaos_test.py::test_a_restarted_driver_forgets_its_recording_and_keeps_the_segments_it_closedfails now and then inintegration-local-slow: afterdocker restart -t 2the driver answers again within a second, butcomputer-readysays not ready for the whole 60 s wait.Why
docker restartkeeps the container's filesystem. When the stop outlasts its grace period, X is killed before it can remove/tmp/.X99-lock. On the next boot pids are handed out again from 1, so the pid in that lock is often taken, by X itself or by another program. X then takes the lock for a server still running and exits withServer is already active for display 99. supervisord retries three times. When the pid belongs to a process that stays up, every retry fails and xvfb endsFATAL. The driver keeps serving, so the readiness checks fail forever.Reproduced on the base image and on a composed desktop: a hard restart left xvfb
FATALwith the reference driverRUNNING.Change
start-desktop xvfbremoves the lock before starting X. supervisord runs one X at a time, so any lock there is stale.RUNNING. It fails on main and passes here._ready's timeout now names the checks that failed, so a computer that never comes up says why.🤖 Generated with Claude Code
The fix appears safe to merge, with a non-blocking gap in the new regression test.
Fix with agent prompt
Summary
Removes the leftover X lock before
Xvfbstarts after a hard restart.Reviews (1) · Last reviewed commit: "fix(computers): a restarted desktop clea..." · Reviewed by Greptile