tests/run_wine_tests: one timing log per child, so --jobs tests pass on Windows (TEST-WINE-JOBS-TIMING-WINDOWS) #1722

Open
github-bot wants to merge 1 commit from github-bot/gh-1722 into main AGit
Owner

@⁠kurrutako on GitHub · 2026-11-25 09:43 UTC · original
kurrutako:test/wine-jobs-timing-windows → main · +10 −5 · 1 files · 1 commits · open

Claimed in the coordination issue as: TEST-WINE-JOBS-TIMING-WINDOWS (#1608)

What and why

On native Windows, test_jobs_runs_that_many_tests_at_a_time and test_jobs_keeps_locks_serial_tests_and_dependencies
in tests/test_run_wine_tests.py fail on every run, with IndexError (a span with no end) or ValueError (two lines
merged into one) in intervals().

The timed() child processes all append to one shared timing.log at the same time. Appends from several processes
to 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, and intervals() reads them all.
scripts/run_wine_tests.py is unchanged.

Tested

Windows 11, Python 3.14, on main 3de22a1:

  • 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

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a)

🤖 Generated with Claude Code

**@⁠kurrutako** on GitHub · 2026-11-25 09:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1722) `kurrutako:test/wine-jobs-timing-windows` → `main` · +10 −5 · 1 files · 1 commits · open Claimed in the coordination issue as: TEST-WINE-JOBS-TIMING-WINDOWS (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why On native Windows, `test_jobs_runs_that_many_tests_at_a_time` and `test_jobs_keeps_locks_serial_tests_and_dependencies` in `tests/test_run_wine_tests.py` fail on every run, with `IndexError` (a span with no end) or `ValueError` (two lines merged into one) in `intervals()`. The `timed()` child processes all append to one shared `timing.log` at the same time. Appends from several processes to 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`, and `intervals()` reads them all. `scripts/run_wine_tests.py` is unchanged. ### Tested Windows 11, Python 3.14, on `main` `3de22a1`: - `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 - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:02:26 +00:00
Author
Owner

@⁠lixonik on GitHub · 2026-11-25 10:23 UTC · original · reviewed

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_jobs tests passed on the PR. The full-file runs exposed two pre-existing uses of Python 3.11's contextlib.chdir on 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.

**@⁠lixonik** on GitHub · 2026-11-25 10:23 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1722#pullrequestreview-6055779085) · **reviewed** 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_jobs` tests passed on the PR. The full-file runs exposed two pre-existing uses of Python 3.11's `contextlib.chdir` on 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.
Author
Owner

@⁠kurrutako on GitHub · 2026-11-25 10:28 UTC · original · edited 2026-11-26 13:59 UTC

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_jobs tests passed on the PR. The full-file runs exposed two pre-existing uses of Python 3.11's contextlib.chdir on 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.

**@⁠kurrutako** on GitHub · 2026-11-25 10:28 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1722#issuecomment-7159736857) · edited 2026-11-26 13:59 UTC > 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_jobs` tests passed on the PR. The full-file runs exposed two pre-existing uses of Python 3.11's `contextlib.chdir` on 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.
Author
Owner

@⁠OguzSoykan on GitHub · 2026-11-25 20:14 UTC · original

Verified on native Windows at head 67b81fe83: tests/test_run_wine_tests.py errors on main in test_jobs_runs_that_many_tests_at_a_time and test_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 alias C:\Users\OUZ~1\...). No game files.

AI-assisted (Claude Code).

**@⁠OguzSoykan** on GitHub · 2026-11-25 20:14 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1722#issuecomment-7173376957) Verified on native Windows at head `67b81fe83`: `tests/test_run_wine_tests.py` errors on `main` in `test_jobs_runs_that_many_tests_at_a_time` and `test_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 alias `C:\Users\OUZ~1\...`). No game files. AI-assisted (Claude Code).
Author
Owner

@⁠DanielMarcos1 on GitHub · 2026-11-26 22:32 UTC · original

Independent verification on native Windows with Python 3.13.17, using the exact test fixture from PR head 67b81fe837b0b4ef9045d3d9e8205666aaf65268 with the local runner at e5a7c8942.

  • Full tests/test_run_wine_tests.py suite: 60 passed, 12 skipped.
  • Repeated the worker-count test and the resource-lock/serial/dependency test 10 times each: 20 of 20 passed.
  • For comparison, the two tests produced 5 errors in 16 runs with the shared log on the same machine. One captured log contained a blank line and was missing a child’s end record.

No game files or GPU were used. Test verification was AI-assisted with Codex.

**@⁠DanielMarcos1** on GitHub · 2026-11-26 22:32 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1722#issuecomment-7204776441) Independent verification on native Windows with Python 3.13.17, using the exact test fixture from PR head `67b81fe837b0b4ef9045d3d9e8205666aaf65268` with the local runner at `e5a7c8942`. - Full `tests/test_run_wine_tests.py` suite: 60 passed, 12 skipped. - Repeated the worker-count test and the resource-lock/serial/dependency test 10 times each: 20 of 20 passed. - For comparison, the two tests produced 5 errors in 16 runs with the shared log on the same machine. One captured log contained a blank line and was missing a child’s end record. No game files or GPU were used. Test verification was AI-assisted with Codex.
Author
Owner

@⁠Andretuta on GitHub · 2026-11-27 06:24 UTC · original

Both --jobs timing cases errored on native Windows at main d1dff7949. With 67b81fe83 in the local CI integration and #2193's two-worker runner, test_run_wine_tests.py completed with 60 passes and 12 skips. This was one local run.

AI-assisted testing.

**@⁠Andretuta** on GitHub · 2026-11-27 06:24 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1722#issuecomment-7211503104) Both `--jobs` timing cases errored on native Windows at `main` `d1dff7949`. With `67b81fe83` in the local CI integration and #2193's two-worker runner, `test_run_wine_tests.py` completed with 60 passes and 12 skips. This was one local run. AI-assisted testing.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1722/head:github-bot/gh-1722'
git switch 'github-bot/gh-1722'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1722'
git switch 'github-bot/gh-1722'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1722'
git switch 'github-bot/gh-1722'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1722'
git switch 'main'
git merge --squash 'github-bot/gh-1722'
git switch 'main'
git merge --ff-only 'github-bot/gh-1722'
git switch 'main'
git merge 'github-bot/gh-1722'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.