tests: the parallel timeout case no longer times out its healthy modules on a loaded CPU (TEST-SEMANTIC-TIMEOUT-QUICK-LOAD) #2135

Merged
Anonymous78e merged 1 commit from upstream-pr/2135 into main 2026-12-01 15:17:10 +00:00
Anonymous78e commented 2026-11-25 22:28:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Anonymous78e on 2026-11-25T22:28:52Z.


Claimed in the coordination issue as: TEST-SEMANTIC-TIMEOUT-QUICK-LOAD (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7175566137)

What and why

tests/test_run_semantic_tests.py::RunnerTest::test_parallel_timeout_reports_partial_output_and_keeps_healthy_modules runs a hanging module and two healthy ones with -j 2 --timeout 1. --timeout limits every module subprocess, so when the CPU is busy the healthy modules also hit the 1 s limit, even after unittest has printed OK, and the test fails with 3 files, 0 tests, 3 files failed (or 2 files failed) instead of 3 files, 4 tests, 1 files failed. I first saw it while running the standard-library tests in parallel on Windows.

The run now uses --timeout 10. The healthy modules do not reach that limit, and the hanging module sleeps for 60 s, so it still times out and the test still checks the partial output, the TIMED OUT after 10 s line and the count. cli() takes an optional subprocess limit (15 s by default, as before), and this call uses 60 s. Test-only; the runner is not changed. Same kind of fix as #1427.

Tested

Windows 11, Python 3.13, on main ab2fb71cb, running only this test (python -I tests/test_run_semantic_tests.py RunnerTest.test_parallel_timeout_reports_partial_output_and_keeps_healthy_modules), with 32 busy-looping processes on a 16-thread CPU:

under load without load
main 9 of 12 runs fail (the last 3 ran after the load ended) 0 of 5 fail
this PR 0 of 12 runs fail passes

The whole file passes (26 tests, 1 skipped, about 40 s, the same as before), also after rebasing onto main b73968599. python -I scripts/check_no_game_data.py tests/test_run_semantic_tests.py is clean.

Limit: with 48 busy processes (3 times the CPU) a module can still take more than 10 s just to start, and 2 of 10 runs failed. A higher limit would make every run of this test that much longer.

GPUs tested: n/a (no GPU involved)

AI-assisted: yes (Claude Code)

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: no translator change)

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5500272102 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2135). Originally posted by [Anonymous78e](https://github.com/Anonymous78e) on 2026-11-25T22:28:52Z. --- Claimed in the coordination issue as: TEST-SEMANTIC-TIMEOUT-QUICK-LOAD (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7175566137) ### What and why `tests/test_run_semantic_tests.py::RunnerTest::test_parallel_timeout_reports_partial_output_and_keeps_healthy_modules` runs a hanging module and two healthy ones with `-j 2 --timeout 1`. `--timeout` limits every module subprocess, so when the CPU is busy the healthy modules also hit the 1 s limit, even after unittest has printed `OK`, and the test fails with `3 files, 0 tests, 3 files failed` (or `2 files failed`) instead of `3 files, 4 tests, 1 files failed`. I first saw it while running the standard-library tests in parallel on Windows. The run now uses `--timeout 10`. The healthy modules do not reach that limit, and the hanging module sleeps for 60 s, so it still times out and the test still checks the partial output, the `TIMED OUT after 10 s` line and the count. `cli()` takes an optional subprocess limit (15 s by default, as before), and this call uses 60 s. Test-only; the runner is not changed. Same kind of fix as #1427. ### Tested Windows 11, Python 3.13, on `main` ab2fb71cb, running only this test (`python -I tests/test_run_semantic_tests.py RunnerTest.test_parallel_timeout_reports_partial_output_and_keeps_healthy_modules`), with 32 busy-looping processes on a 16-thread CPU: | | under load | without load | |---|---|---| | `main` | 9 of 12 runs fail (the last 3 ran after the load ended) | 0 of 5 fail | | this PR | 0 of 12 runs fail | passes | The whole file passes (26 tests, 1 skipped, about 40 s, the same as before), also after rebasing onto `main` b73968599. `python -I scripts/check_no_game_data.py tests/test_run_semantic_tests.py` is clean. Limit: with 48 busy processes (3 times the CPU) a module can still take more than 10 s just to start, and 2 of 10 runs failed. A higher limit would make every run of this test that much longer. GPUs tested: n/a (no GPU involved) AI-assisted: yes (Claude Code) ### 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: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
EdenBendheim commented 2026-11-26 05:17:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by EdenBendheim on 2026-11-26T05:17:15Z.


Note

🤖 gpt-6.2-sol responding on behalf of EdenBendheim

Independent verification of head 1c0380bcd4c390466567e278783f32c148c4c3a6 on current main a73a57e13 (macOS 27.3, Python 3.12.14, CPU-only synthetic fixtures).

  • Full tests/test_run_semantic_tests.py: 26/26 on main (5.30 s) and PR (14.64 s).
  • Controlled regression: added a two-second startup delay to each healthy synthetic fixture in memory, without loading the host CPU. The original timeout test failed with three failed files instead of one; the PR version passed, still asserting that the hanging module times out and preserving the expected marker/count.
  • Clean simulated merges with main and #2193; diff/no-game-data checks clean.

The roughly nine-second increase in the test suite is the expected tradeoff for this fix. No blocking findings.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7183350434 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2135#issuecomment-7183350434). Originally posted by [EdenBendheim](https://github.com/EdenBendheim) on 2026-11-26T05:17:15Z. --- > [!NOTE] > 🤖 **gpt-6.2-sol responding on behalf of EdenBendheim** Independent verification of head `1c0380bcd4c390466567e278783f32c148c4c3a6` on current main `a73a57e13` (macOS 27.3, Python 3.12.14, CPU-only synthetic fixtures). - Full `tests/test_run_semantic_tests.py`: 26/26 on main (5.30 s) and PR (14.64 s). - Controlled regression: added a two-second startup delay to each healthy synthetic fixture in memory, without loading the host CPU. The original timeout test failed with three failed files instead of one; the PR version passed, still asserting that the hanging module times out and preserving the expected marker/count. - Clean simulated merges with main and #2193; diff/no-game-data checks clean. The roughly nine-second increase in the test suite is the expected tradeoff for this fix. No blocking findings.
real-rusher commented 2026-11-26 12:23:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by real-rusher on 2026-11-26T12:23:53Z.


Checked on main a73a57e1 (Ubuntu 24.04 x86-64, 2 cores, Python 3.13). Merges cleanly. python -I tests/test_run_semantic_tests.py: 26 tests OK with this PR (14.9 s), and also OK on main (15.1 s): this machine is not loaded enough to reproduce the timeout the PR fixes, so this is only a no-regression check.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7191948738 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2135#issuecomment-7191948738). Originally posted by [real-rusher](https://github.com/real-rusher) on 2026-11-26T12:23:53Z. --- Checked on main a73a57e1 (Ubuntu 24.04 x86-64, 2 cores, Python 3.13). Merges cleanly. python -I tests/test_run_semantic_tests.py: 26 tests OK with this PR (14.9 s), and also OK on main (15.1 s): this machine is not loaded enough to reproduce the timeout the PR fixes, so this is only a no-regression check. AI-assisted: yes (Claude Code)
aslan2142 commented 2026-12-01 11:39:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:39:14Z.


Draft PR review note: raising --timeout from 1 to 10 (with subprocess timeout=60) in tests/test_run_semantic_tests.py:58-76 looks clean, merges cleanly with main, and is still not on main (tests/test_run_semantic_tests.py:77 still uses 1). When you're ready to land it, please mark ready for review and trigger a fresh green CI pass on current main.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7309938788 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2135#issuecomment-7309938788). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:39:14Z. --- Draft PR review note: raising `--timeout` from `1` to `10` (with subprocess `timeout=60`) in `tests/test_run_semantic_tests.py:58-76` looks clean, merges cleanly with `main`, and is still not on `main` (`tests/test_run_semantic_tests.py:77` still uses `1`). When you're ready to land it, please mark ready for review and trigger a fresh green CI pass on current `main`. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 12:22:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:22:53Z.


Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.

(AI-assisted triage.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7311049683 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2135#issuecomment-7311049683). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T12:22:53Z. --- Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review. *(AI-assisted triage.)*
aslan2142 commented 2026-12-01 13:03:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T13:03:30Z.

Review: APPROVED


Now ready for review and MERGEABLE. Clean-room verified: tests/test_run_semantic_tests.py:58-76 cleanly prevents healthy synthetic modules from timing out under CPU load (independently verified by @EdenBendheim and @real-rusher).

Approving — ready to merge once fresh CI runs green on current main (existing Nov 26 failures are stale).

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6131787357 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2135#pullrequestreview-6131787357). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T13:03:30Z. **Review:** APPROVED --- Now ready for review and `MERGEABLE`. Clean-room verified: `tests/test_run_semantic_tests.py:58-76` cleanly prevents healthy synthetic modules from timing out under CPU load (independently verified by `@EdenBendheim` and `@real-rusher`). Approving — ready to merge once fresh CI runs green on current `main` (existing Nov 26 failures are stale). *(AI-assisted review.)*
merzleckeier commented 2026-12-01 13:33:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T13:33:45Z.


Verified the timeout boundary with a deterministic slow test on CPython 3.14.10 at 1c0380bcd + e04721c7. I added a 1.3-second delay to one otherwise passing fixture on both sides. Main’s one-second module limit marked the healthy fixture and the hanging fixture as failures. The PR let both healthy fixtures finish and still killed the hanging one after ten seconds, with its partial output and the expected summary. The full checked-in runner suite passed 34 tests with one skip.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7312820120 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2135#issuecomment-7312820120). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-01T13:33:45Z. --- Verified the timeout boundary with a deterministic slow test on CPython 3.14.10 at `1c0380bcd` + `e04721c7`. I added a 1.3-second delay to one otherwise passing fixture on both sides. Main’s one-second module limit marked the healthy fixture and the hanging fixture as failures. The PR let both healthy fixtures finish and still killed the hanging one after ten seconds, with its partial output and the expected summary. The full checked-in runner suite passed 34 tests with one skip. AI-assisted with OpenAI Codex.
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!2135
No description provided.