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

Open
opened 2026-11-26 21:20:10 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2135
Author: @Anonymous78e
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: test/semantic-timeout-quick-load


📝 Commits (1)

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

📊 Changes

1 file changed (+6 additions, -4 deletions)

View changed files

📝 tests/test_run_semantic_tests.py (+6 -4)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2135 **Author:** [@Anonymous78e](https://github.com/Anonymous78e) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test/semantic-timeout-quick-load` --- ### 📝 Commits (1) - [`1c0380b`](https://github.com/ubiquitarianism/leonida/commit/1c0380bcd4c390466567e278783f32c148c4c3a6) tests: the parallel timeout case no longer times out its healthy modules on a loaded CPU (TEST-SEMANTIC-TIMEOUT-QUICK-LOAD) ### 📊 Changes **1 file changed** (+6 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_run_semantic_tests.py` (+6 -4) </details> ### 📄 Description 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#2139
No description provided.