test: make startup watcher launch control deterministic #2315
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2323"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T12:17:15Z.
The Linux launcher check intermittently missed the "watcher without --render" mutant when the debugger stub exited before the background watcher reached Python. Sleeping after the launcher exited could not recover the marker.
The negative control now marks the watcher launch synchronously in the copied shell script, after it captures the child's PID. The existing markers still check real watcher startup and shutdown. Production launcher behavior is unchanged.
Validation on Ubuntu 22.04 under WSL at
df121178:python3 -B tests/startup_run_sh_check.py -vdetected all mutants and ended withstartup run.sh: 0 failed. The hosted occurrence was in #2084.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T12:25:25Z.
Review: COMMENTED
Review of head
df12117800099ef70c0abc423359d3e7849dd05c(test-only change,tests/startup_run_sh_check.py).Findings: 0 P1, 0 P2. Clean-room: no external code, no ISA content.
The fixed
time.sleep(1)is replaced by a marker file (watch-spawn.flag) written by the test copy ofrun.shright afterwatcher=$!. It is written by the parent shell, so it no longer races with the stub debugger exiting early.replace()raises if the anchor is not found exactly once, so a change torun.shfails loudly instead of silently disabling the check.Commands executed locally:
python3 tests/startup_run_sh_check.py(3 runs):startup run.sh: 0 failedeach timepython3 tests/docs_links_check.py: 18 files, 451 links OKpython3 tests/bidi_controls_check.py: no bidirectional controlsgit diff --check origin/main...HEAD: cleantools/startup/run.shthe watcher condition changed from[ -n "$translate" ] && [ -n "$render" ]to[ -n "$translate" ]. The test FAILED as expected:FAIL stub exit 0 --translate: the translator started without --render --translate(1 failed). Restored withgit checkout -- ..Build and test on Windows, Linux Python checks and fixture assembly all SUCCESS.Only a
.pyfile is touched, so the pure-Python fast path applies.AI-assisted; commands listed were executed locally.