Repository navigation
tests/run_wine_tests: one timing log per child, so --jobs tests pass on Windows (TEST-WINE-JOBS-TIMING-WINDOWS) - #1722
Conversation
…on Windows (TEST-WINE-JOBS-TIMING-WINDOWS) test_jobs_runs_that_many_tests_at_a_time and test_jobs_keeps_locks_serial_tests_and_dependencies failed on every native Windows run with IndexError or ValueError in intervals(). The timed() children appended to one shared timing.log at the same time; appends from several processes are not atomic on Windows, so lines were lost or merged. Each child now writes timing/<name>.log and intervals() reads them all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lixonik
left a comment
There was a problem hiding this comment.
Independent A/B at 67b81fe8 against 3de22a19, with synthetic subprocesses.
- Native Windows, Python 3.12.1, four runs of
tests/test_run_wine_tests.py -k test_jobs: the base failed all four runs with incomplete or malformed timing records. The PR passed all four runs. The full Windows file passed (60 tests reported, 12 skips). - Ubuntu under WSL, Python 3.10.12: all four
test_jobstests passed on the PR. The full-file runs exposed two pre-existing uses of Python 3.11'scontextlib.chdiron both revisions. The two timing tests also failed on the base with the scratch directory on a Windows-mounted volume.
AI-assisted testing. CPU only, no GPU or game data.
Thanks for the independent A/B on Windows and WSL. The WSL volume result matches the cause: appends from several processes aren't reliable on Windows file systems. The contextlib.chdir failures are pre-existing and Python 3.10 is below the project's 3.12 minimum, so I've left them out of this PR. |
|
Verified on native Windows at head Native Windows 10 Pro 19045, CPython 3.12, AI-assisted (Claude Code). |
|
Independent verification on native Windows with Python 3.13.17, using the exact test fixture from PR head
No game files or GPU were used. Test verification was AI-assisted with Codex. |
|
Both AI-assisted testing. |
Claimed in the coordination issue as: TEST-WINE-JOBS-TIMING-WINDOWS (#1608 (comment))
What and why
On native Windows,
test_jobs_runs_that_many_tests_at_a_timeandtest_jobs_keeps_locks_serial_tests_and_dependenciesin
tests/test_run_wine_tests.pyfail on every run, withIndexError(a span with no end) orValueError(two linesmerged into one) in
intervals().The
timed()child processes all append to one sharedtiming.logat the same time. Appends from several processesto one file are not atomic on Windows, so lines are lost or merged. Reproduced outside the test: six processes doing
the same two appends to one file left 11 lines instead of 12.
The fix is in the test only: each child writes its own
timing/<name>.log, andintervals()reads them all.scripts/run_wine_tests.pyis unchanged.Tested
Windows 11, Python 3.14, on
main3de22a1:python -I tests/test_run_wine_tests.py: before,FAILED (errors=2, skipped=12)on every run; after,OK (skipped=12)on 4 of 4 runs.python -I tests/test_text_write_line_endings.py: OK.Not run on Linux; the change does not depend on the platform.
GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a)🤖 Generated with Claude Code