tests: a locked recorder.exe no longer hides the cmake batch case's result (TEST-CMAKE-BATCH-CLEANUP) #1439
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1439"
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 Anonymous78e on 2026-11-25T00:16:05Z.
Claimed in the coordination issue as: TEST-CMAKE-BATCH-CLEANUP (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148310075)
What and why
Part (3) of @GTAVIB4GTAVI's parallel-load finding (#14). Parts (1) and (2) are #1410 and #1002.
tests/test_build_runtime_cmake.pybuilds each case intempfile.TemporaryDirectory(dir=self.base)and copies arecorder.exeinto it, which a child process runs. When Windows still holds that image at cleanup (antivirus, a late handle close),shutil.rmtreeraisesPermissionError: [WinError 5]and that error replaces the case's own result, as reported:Both temp folders, the per-case one and the class one that holds the compiled recorder, now pass
ignore_cleanup_errors=True(Python 3.10+; the project needs 3.12+), so the assertion stays in charge. Nothing else changes.Tested
Windows 11 Pro 26H2, CPython 3.13.15, on
main1154976d4:The mechanism, deterministically: a file held open inside a
TemporaryDirectorywhose body fails an assertion.main)PermissionError: [WinError 32] ...ignore_cleanup_errors=TrueAssertionError: the case's own assertionpython -I tests/test_build_runtime_cmake.py: 1 test (27 subtests) OK in 11 s with this change.scripts/check_no_game_data.pyon the file: clean.GPUs tested: n/a
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
https://claude.ai/code/session_014sDZDAAcsauTL6d8ie67Qo
Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T15:28:11Z.
Reviewed
751de4d16: both TemporaryDirectory calls in test_build_runtime_cmake.py now pass ignore_cleanup_errors=True, so a still-locked recorder.exe at cleanup can no longer replace (or masquerade as) a case's result: both the class-level folder and each subTest's copied recorder. Could not run the suite here (Windows-only: csc.exe and powershell.exe; on this Linux box it exitsOK (skipped=1)and compiles clean); fault injection also cannot reproduce the lock here, so this is a code-reading review: I verified the mechanism by reading tempfile's routing: cleanup() forwards the flag and every raise site in rmtree's onexc, including the locked-file PermissionError branch, is behindif not ignore_errors; README pins Python 3.12+ and the ci check job runs this file on windows-latest. Leaked leonida_cmake* folders when cleanup does fail are the accepted trade-off. No findings.AI-assisted review.
Recommendation: Merge
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:50:48Z.
Verified by OreoFR
3408969a7+ PR head751de4d16python -I tests/test_build_runtime_cmake.pyAI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T00:55:28Z.
#1439 | head
751de4d16c(merged cleanly onto origin/maina3484ceebc) | Windows 11 (10.0.26200.9974, NTFS), Python 3.12.10 | AI-assisted: yesIndependent Verification (Windows 11 + NTFS)
+4/-2intests/test_build_runtime_cmake.py) passingignore_cleanup_errors=Trueto bothtempfile.TemporaryDirectorycalls inCMakeBatchTest.python -I scripts/check_no_game_data.py tests/test_build_runtime_cmake.pypassed (rc=0).origin/maina3484ceebcvs#1439 + origin/main):.exeteardown): Verified on Windows 11 NTFS that leaving an open handle onrecorder.exeinside atempfile.TemporaryDirectory()block raisesPermissionError([WinError 32]) during__exit__whenignore_cleanup_errors=Trueis omitted, masking any assertion outcome from the body, whereasTemporaryDirectory(ignore_cleanup_errors=True)exits cleanly without masking test assertions.#1439 + origin/main, native Windowscsc.exe+cmd.exebatch matrix):python -I tests/test_build_runtime_cmake.py->1/1(OK,0skipped,31.23s), executing the full Windows-onlyCMakeBatchTest.exe/.cmd/.batand failure-mode subtest matrix end-to-end.Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T14:17:16Z.
Correction: not in
main. Its squash commit44a715d10landed on 2026-11-27, but00131bb85("main keeps its own runtime, tools and tests; the branch's variants stay on port/d3d12-nvidia") restoredtests/test_build_runtime_cmake.pythe same day, somaindoes not have this change. I took the earlier verdict from the history (git cherryand the squash title), not from the tree. Re-checked onmainc22a0a732:git merge-tree --write-treeofmainand this branch gives a tree that still differs frommainintests/test_build_runtime_cmake.py.New verdict: ready for testing. It merges cleanly with
mainc22a0a732.This pull request was closed on the basis of our earlier, wrong verdict. Its change is not on main, so the author or a maintainer can reopen it.
AI-assisted (Claude Code).
Earlier comment, superseded by the correction above:
Already in main: squashed as
44a715d10(2026-11-27, "PR #1439: tests: a locked recorder.exe no longer hides the cmake batch case's result (TEST-CMAKE-BATCH-CLEANUP)"), which is inmain3535eb5c4.git cherryfinds this branch's commit there, so nothing is left to merge here.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T14:30:13Z.
Closing: this landed on main as
44a715d10("PR #1439: tests: a locked recorder.exe no longer hides..."), checked in main just now. Thanks for the fix!Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T14:58:04Z.
Correction: I closed this as already on main, and that was wrong. Its commit did land, but
00131bb85(27/11, "main keeps its own runtime, tools and tests") removed those lines again, so main does not have this change today. I tried to reopen it, but GitHub refuses: you are at this repository's open pull request limit. You can reopen it yourself once one of your PRs is merged or closed, or say here if you want a maintainer to carry it forward with your commits. Sorry for the noise.AI-assisted: yes (checked line by line against current main)
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:36:05Z.
Review: APPROVED
LGTM. Passing
ignore_cleanup_errors=Trueto bothtempfile.TemporaryDirectorycalls intests/test_build_runtime_cmake.py:38,96cleanly prevents a temporarily lockedrecorder.exeon Windows from masking subtest results (confirmed not present on currentmain). Clean-room verified andMERGEABLE; holding merge until a fresh green CI pass completes on currentmain.(AI-assisted review.)