tests/run_wine_tests: one timing log per child, so --jobs tests pass on Windows (TEST-WINE-JOBS-TIMING-WINDOWS) #1722
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1722"
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 kurrutako on 2026-11-25T09:43:35Z.
Claimed in the coordination issue as: TEST-WINE-JOBS-TIMING-WINDOWS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7158675336)
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
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-25T10:23:49Z.
Review: COMMENTED
Independent A/B at
67b81fe8against3de22a19, with synthetic subprocesses.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).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.
Imported from ubiquitarianism/leonida. Originally posted by kurrutako on 2026-11-25T10:28:09Z.
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.
Imported from ubiquitarianism/leonida. Originally posted by OguzSoykan on 2026-11-25T20:14:16Z.
Verified on native Windows at head
67b81fe83:tests/test_run_wine_tests.pyerrors onmainintest_jobs_runs_that_many_tests_at_a_timeandtest_jobs_keeps_locks_serial_tests_and_dependencies(the shared timing log loses lines,IndexError/ValueError: not enough values to unpack) and passes here (72 tests, OK, 12 skipped).Native Windows 10 Pro 19045, CPython 3.12,
py -3.12 -I, checkout under a non-ASCII profile path (C:\Users\Oğuz\..., TEMP is the 8.3 aliasC:\Users\OUZ~1\...). No game files.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by DanielMarcos1 on 2026-11-26T22:32:54Z.
Independent verification on native Windows with Python 3.13.17, using the exact test fixture from PR head
67b81fe837b0b4ef9045d3d9e8205666aaf65268with the local runner ate5a7c8942.tests/test_run_wine_tests.pysuite: 60 passed, 12 skipped.No game files or GPU were used. Test verification was AI-assisted with Codex.
Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-27T06:24:46Z.
Both
--jobstiming cases errored on native Windows atmaind1dff7949. With67b81fe83in the local CI integration and #2193's two-worker runner,test_run_wine_tests.pycompleted with 60 passes and 12 skips. This was one local run.AI-assisted testing.