check_d3d12_trace: finish communicate() after killing a timed-out fixture (OLD-9920) #1330

Merged
fin-github merged 2 commits from upstream-pr/1330 into main 2026-11-28 20:14:17 +00:00
fin-github commented 2026-11-24 21:58:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fin-github on 2026-11-24T21:58:08Z.


Claimed in the coordination issue as: OLD-9920 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7145581073)

Supersedes draft #188, carried over from old upstream PR 9920 in the original repository. This is the same change cherry-picked onto current main (git cherry-pick -x), with the original author (Sunkiller-qc) kept on every commit. The change and its explanation are theirs; see #188 for the original description.

Tested

Windows 11 Pro 26200, CPython 3.14.4, on main 4a50cafc7. No GPU, no game files.

  • On this branch: tests/test_check_d3d12_trace.py: 4 tests OK (1 skipped), 4.6 s
  • The same test file(s) with main's code: test_runner_timeout_does_not_wait_for_a_child_holding_the_output fails (32 s run), so the tests still catch the bug on current main.
  • scripts/check_no_game_data.py on the changed files and tests/test_text_write_line_endings.py: clean.

GPUs tested: n/a

AI-assisted: yes (Claude Code). The cherry-pick and the test runs were done by the agent; the code is the original author's.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5481019228 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1330). Originally posted by [fin-github](https://github.com/fin-github) on 2026-11-24T21:58:08Z. --- Claimed in the coordination issue as: `OLD-9920` (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7145581073) Supersedes draft #188, carried over from old upstream PR 9920 in the original repository. This is the same change cherry-picked onto current `main` (`git cherry-pick -x`), with the original author (Sunkiller-qc) kept on every commit. The change and its explanation are theirs; see #188 for the original description. ### Tested Windows 11 Pro 26200, CPython 3.14.4, on `main` 4a50cafc7. No GPU, no game files. - On this branch: `tests/test_check_d3d12_trace.py`: 4 tests OK (1 skipped), 4.6 s - The same test file(s) with `main`'s code: `test_runner_timeout_does_not_wait_for_a_child_holding_the_output` fails (32 s run), so the tests still catch the bug on current `main`. - `scripts/check_no_game_data.py` on the changed files and `tests/test_text_write_line_endings.py`: clean. GPUs tested: n/a AI-assisted: yes (Claude Code). The cherry-pick and the test runs were done by the agent; the code is the original author's.
whoalin1 commented 2026-11-24 23:36:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-24T23:36:39Z.


Independent verification (AI-assisted, overnight review batch):

  • Checked out 6240af0; diff reworks run_fixture in runtime/test/check_d3d12_trace.py to capture stdout/stderr in tempfile.TemporaryFiles instead of pipes, wait(timeout), and a new kill_tree (killpg on POSIX-with-runner, taskkill /F /T on Windows, process.kill() otherwise).
  • Bug repro confirmed on origin/main: same synthetic runner+grandchild scenario — main's version blocked ~20 s (waited for the pipe-holding child to exit) before reporting the timeout; the PR branch reports no exit within 2s at ~the limit.
  • python -I -m pytest tests/test_check_d3d12_trace.py: 3 passed + 1 skipped (POSIX-only) in 6.4 s on rerun.
  • check_no_game_data.py on both changed files: clean. compileall clean.
  • Caveats observed on this machine (Windows 11, CPython 3.14.4, Defender active):
    • The new test test_runner_timeout_does_not_wait_for_a_child_holding_the_output is timing-sensitive: one run measured 15.39 s vs its assertLess(elapsed, 15) bound and flaked a TemporaryDirectory teardown (orphaned grandchild briefly locks the dir). A rerun passed in 6.4 s. If taskkill exceeds its internal 5 s timeout under load, the grandchild can be orphaned — the check itself still exits on time, so this is a test-robustness note, not a correctness bug.
    • Verified directly that taskkill /F /T /PID does kill the whole tree when it completes (child PID terminated along with the launcher).
  • No GPU, no game files, no Wine needed. LGTM with the flakiness note above.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7147596510 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1330#issuecomment-7147596510). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-24T23:36:39Z. --- Independent verification (AI-assisted, overnight review batch): - Checked out 6240af0; diff reworks `run_fixture` in `runtime/test/check_d3d12_trace.py` to capture stdout/stderr in `tempfile.TemporaryFile`s instead of pipes, `wait(timeout)`, and a new `kill_tree` (killpg on POSIX-with-runner, `taskkill /F /T` on Windows, `process.kill()` otherwise). - Bug repro confirmed on `origin/main`: same synthetic runner+grandchild scenario — main's version blocked ~20 s (waited for the pipe-holding child to exit) before reporting the timeout; the PR branch reports `no exit within 2s` at ~the limit. - `python -I -m pytest tests/test_check_d3d12_trace.py`: 3 passed + 1 skipped (POSIX-only) in 6.4 s on rerun. - `check_no_game_data.py` on both changed files: clean. compileall clean. - Caveats observed on this machine (Windows 11, CPython 3.14.4, Defender active): - The new test `test_runner_timeout_does_not_wait_for_a_child_holding_the_output` is timing-sensitive: one run measured 15.39 s vs its `assertLess(elapsed, 15)` bound and flaked a TemporaryDirectory teardown (orphaned grandchild briefly locks the dir). A rerun passed in 6.4 s. If taskkill exceeds its internal 5 s timeout under load, the grandchild can be orphaned — the check itself still exits on time, so this is a test-robustness note, not a correctness bug. - Verified directly that `taskkill /F /T /PID` does kill the whole tree when it completes (child PID terminated along with the launcher). - No GPU, no game files, no Wine needed. LGTM with the flakiness note above.
MoonEyes commented 2026-11-25 17:13:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-25T17:13:24Z.


Thanks! For reference, #1338 has a byte-identical diff (same two commits) and was opened a few minutes after this one, so this PR looks like the one to keep; maintainers can decide.

AI-assisted: yes (Claude Code compared the diffs against origin/main; I reviewed it).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7169187471 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1330#issuecomment-7169187471). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-25T17:13:24Z. --- Thanks! For reference, #1338 has a byte-identical diff (same two commits) and was opened a few minutes after this one, so this PR looks like the one to keep; maintainers can decide. AI-assisted: yes (Claude Code compared the diffs against origin/main; I reviewed it).
MoonEyes commented 2026-11-28 20:14:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T20:14:14Z.


Red/green: On main test_check_d3d12_trace.py fails because a timed-out fixture whose child holds the output takes 32 s instead of under 15 s, and with the PR it passes (4 OK, ctest d3d12_trace OK) on Windows 11 at OreoFR's (RTX 4070).
Independent tester (OreoFR, RTX 4070, Windows 11): PR head merged with the other PRs of its batch on main c1ecf04ed, full ctest run (485 tests, tests that launch the game excluded): no new failure compared with main.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7245136771 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1330#issuecomment-7245136771). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T20:14:14Z. --- Red/green: On main test_check_d3d12_trace.py fails because a timed-out fixture whose child holds the output takes 32 s instead of under 15 s, and with the PR it passes (4 OK, ctest d3d12_trace OK) on Windows 11 at OreoFR's (RTX 4070). Independent tester (OreoFR, RTX 4070, Windows 11): PR head merged with the other PRs of its batch on main c1ecf04ed, full ctest run (485 tests, tests that launch the game excluded): no new failure compared with main.
OreoFR commented 2026-11-28 21:48:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:48:54Z.


Verified by OreoFR

  • Base: main 3408969a7 + PR head 6240af03a; green run in a merge package of 3 PRs, no new ctest failure vs main
  • Test: python -I tests/test_check_d3d12_trace.py ; ctest -R ^d3d12_trace$
  • Red on main: 1 FAIL (test_runner_timeout_does_not_wait_for_a_child_holding_the_output: 32.1 s instead of < 15 s, the check waits for the grandchild holding the output)
  • Green with the PR: 4 tests OK (1 POSIX skip), ctest d3d12_trace OK, package with no new failure
  • Verdict: READY
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246293586 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1330#issuecomment-7246293586). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:48:54Z. --- **Verified by OreoFR** - Base: main `3408969a7` + PR head `6240af03a`; green run in a merge package of 3 PRs, no new ctest failure vs main - Test: `python -I tests/test_check_d3d12_trace.py ; ctest -R ^d3d12_trace$` - Red on main: 1 FAIL (test_runner_timeout_does_not_wait_for_a_child_holding_the_output: 32.1 s instead of < 15 s, the check waits for the grandchild holding the output) - Green with the PR: 4 tests OK (1 POSIX skip), ctest d3d12_trace OK, package with no new failure - Verdict: READY - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1330
No description provided.