Avoid transient working directory in XCL EOF tests #3162
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3162"
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 ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T15:43:59Z.
Claimed in the coordination issue as TEST-XCL-OUTPUT-EOF-CWD.
What and why
OutputEOFstarts a synthetic Python subprocess that writes to pipes. Let it inherit the test runner's working directory so the test no longer depends on deleting a temporary directory after the subprocess exits. Both EOF cases still start a real subprocess and exercise the existing watchdog and exit-code assertions.The Windows CI job on #3160 failed at
os.rmdirin the fixture's teardown withWinError 32. The failing fixture andtools/xcl_compare.pyare identical on that PR andmain. The CI log establishes the failed cleanup path. The identity of the process holding the directory open is unconfirmed.Tested
python -I tests/test_xcl_compare.pypassed all 20 tests on Linux and on Windows CPython 3.12.10 under Wine 11.22.TemporaryDirectory.__exit__while running the original real-subprocess timeout test. The test failed onmain(3c106eb2f) and passed with this change on both runners.git diff --checkandpython -I scripts/check_no_game_data.pypassed. The separate read-only review found no issues.GPUs tested: n/a (synthetic subprocess tests).
AI-assisted: OpenAI Codex (GPT-6), with independent review by GPT-6.2 Sol.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T16:27:20Z.
Checked here: the file's tests pass on both sides, and the change is the simplification it says it is.
The change itself is three lines: the synthetic child that writes to pipes no longer gets a
tempfile.TemporaryDirectory()as its working directory - it inherits the runner's, because it writes to pipes and never touches the tree. The comment says exactly that, which is the part worth keeping: a reader who wonders whether the child could write a file into the repository now has the answer at the call site.What it does not show, and cannot: the flake it avoids. A transient working directory that disappears under a subprocess is a race; both runs pass here, and I would not claim a red side for a change whose failure is by definition intermittent. What it does show is that nothing else in
test_xcl_compare.pymoved - the same 20 tests, in the same 8.8 seconds.AI-assisted: yes - DeepSeek v4.1 (flash).
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:01:42Z.
RUN (independent run on Windows, head
7bc09ed09568492e86817570f50b5264ce0f6b14, merged intomain45dc41f95c1cd0dcc29c2c50582e0e9af8a77259withgit merge --no-ff)Green
python -I tests/test_xcl_compare.pyon the merge: 20 tests, OK.python -I scripts/check_no_game_data.py tests/test_xcl_compare.py: clean.git diff --check: clean.xcl_comparein tests and scripts, so there is no other related test.Red
The PR changes a test only, so there is no tool to swap back. I swapped main's version of the test file back and injected the failure the PR describes:
TemporaryDirectory.__exit__raising a simulatedWinError 32(PermissionError 32), run against the twoOutputEOFtests.This shows the change removes the dependency on that cleanup. It does not show the real holder of the directory, which the PR also says is unconfirmed. Restored afterwards.
Review
tests/test_xcl_compare.py:tmpis replaced byNoneas the cwd ofxc.run_title, with a comment. Still a real subprocess, same assertions.Not covered
run_titlewithcwd=Noneis also fine for the other callers of the tool (not changed by the PR).Verdict: PASS
AI-assisted (Claude Code), models: Claude Opus 5.5 (checker), separate Claude Opus 5.5 judge.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:03:33Z.
Merging. Head
7bc09ed09merges cleanly withmain45dc41f95and does not force a rebase of #2566. Independent red/green posted on this head (20/20 green; with a simulated WinError 32 on temp-dir cleanup, main's OutputEOF tests error 2 of 2 and this head's pass), checked by a separate judge. Merged by MoonEyes.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:11:41Z.
Verified #3162 on Linux: tests pass merged onto current
main, and a simulated Windows cleanup failure is red onmainand green with this change.7bc09ed095main45dc41f95c(git merge --no-ff, clean; merge base3c106eb2ff)Ran
Red/green (simulated, since the real failure is a Windows-only race). A scratch probe replaced
tempfile.TemporaryDirectory.__exit__with one that raisesPermissionError(32)(theWinError 32from the CI log) and ran only theOutputEOFclass:So the change removes the dependency on deleting the temporary directory, which is the failure the description names. It does not prove which process held the directory on the CI runner, as the description itself says.
Review.
tools/xcl_compare.run_titlepassescwdstraight tosubprocess.Popen(cwd=cwd, ...)(tools/xcl_compare.py:162), soNonemeans "inherit", and the child only writes to its pipes. Both EOF cases still start a real subprocess and keep their watchdog and exit-code assertions. No defects found.Verdict: ready. Test-only change, CI green on the head, claim item
TEST-XCL-OUTPUT-EOF-CWDand AI disclosure present.AI-assisted: Claude Opus 5.5 (Claude Code), verification only.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code