run_wine_tests: reject overflowing timeouts (WINE-TIMEOUT-OVERFLOW) #1015

Merged
TheGeogeo merged 1 commit from upstream-pr/1015 into main 2026-11-28 19:34:46 +00:00
TheGeogeo commented 2026-11-24 16:55:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-24T16:55:38Z.


Claimed in the coordination issue as: WINE-TIMEOUT-OVERFLOW — https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7138342601

What and why

An oversized finite --timeout could pass argument parsing and raise OverflowError while waiting for the first subprocess. Bound the option by the largest whole number of seconds that fits Linux poll's signed millisecond timeout. The CLI reports the bound and rejects larger inputs before launching a test. A shorter TIMEOUT from CTest still takes precedence.

Tested

Head b70bde27, rebased on main e18b59a5, same patch as 56bed586 (git range-diff); it merges cleanly with main 747809e7. Windows 11, Python 3.12.4:

  • python -I -B tests/test_run_wine_tests.py, three runs: 74 run, 12 skipped, errors only in test_jobs_keeps_locks_serial_tests_and_dependencies and test_jobs_runs_that_many_tests_at_a_time (three runs each). main e18b59a5 alone: both in two runs of three. With these tests on the runner of main e48ff037, test_timeout_over_process_limit_is_rejected_before_launch fails.
  • tests/test_docs_cli_flags.py, tests/test_text_write_line_endings.py, tests/test_ctest_registration.py, tests/test_ci_registration.py and tests/test_docs_links.py: OK.
  • tests/test_tool_stdout_encoding.py fails in test_every_main_block_reconfigures_stdout, as on main e18b59a5 alone (three tools this change does not touch).
  • compileall, git diff --check and python -I scripts/check_no_game_data.py on the two files: clean.

Earlier head 56bed586, rebased on main 28a32e19; it merged cleanly with main 22372d86. Same patch: only the --timeout help next to the new --jobs option conflicted. Windows 11, Python 3.12.4:

  • python -I -B tests/test_run_wine_tests.py: 74 run, 12 skipped, 1 error, in test_jobs_runs_that_many_tests_at_a_time (the run before also had one in test_jobs_keeps_locks_serial_tests_and_dependencies). Unmodified main 22372d86 gives the same errors (three runs: both twice, only the first named here once), so they do not come from this change.
  • tests/test_tool_stdout_encoding.py, tests/test_docs_cli_flags.py and tests/test_text_write_line_endings.py: OK.
  • git diff --check and python -I -B scripts/check_no_game_data.py scripts/run_wine_tests.py tests/test_run_wine_tests.py: clean.

Earlier heads:

  • c8e02cd4 (same patch as 743755d9, on main 6293c1c4), Windows 11, Python 3.12.4: tests/test_run_wine_tests.py 65 run, OK (9 skipped).
  • On main at 82a2aabc, a synthetic passing test triggered OverflowError with 2147484 seconds on Debian WSL and 1e100 on Debian WSL and Windows. 2147483 completed on Debian.
  • The CLI now rejects both oversized values with exit 2. The focused tests check that no worker launches and that 2147483 completes a passing test.
  • 743755d9: python -I -B tests/test_run_wine_tests.py on Windows, Python 3.12.4, 56 passed and 9 POSIX-only skips; python3 -I -B tests/test_run_wine_tests.py on Debian WSL, Python 3.11.2, 65 passed, and 67 after clean temporary merges with #999 (e8226ee4) and #919 (3de809cf); tests/test_docs_cli_flags.py 4 passed.

GPUs tested: n/a (CPU-only synthetic tests).

AI-assisted: yes (Codex; the rebases on 28a32e19 and e18b59a5 with Claude Code).

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5476601752 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1015). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-24T16:55:38Z. --- Claimed in the coordination issue as: WINE-TIMEOUT-OVERFLOW — https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7138342601 ### What and why An oversized finite `--timeout` could pass argument parsing and raise `OverflowError` while waiting for the first subprocess. Bound the option by the largest whole number of seconds that fits Linux `poll`'s signed millisecond timeout. The CLI reports the bound and rejects larger inputs before launching a test. A shorter `TIMEOUT` from CTest still takes precedence. ### Tested Head `b70bde27`, rebased on `main` `e18b59a5`, same patch as `56bed586` (`git range-diff`); it merges cleanly with `main` `747809e7`. Windows 11, Python 3.12.4: - `python -I -B tests/test_run_wine_tests.py`, three runs: 74 run, 12 skipped, errors only in `test_jobs_keeps_locks_serial_tests_and_dependencies` and `test_jobs_runs_that_many_tests_at_a_time` (three runs each). `main` `e18b59a5` alone: both in two runs of three. With these tests on the runner of `main` `e48ff037`, `test_timeout_over_process_limit_is_rejected_before_launch` fails. - `tests/test_docs_cli_flags.py`, `tests/test_text_write_line_endings.py`, `tests/test_ctest_registration.py`, `tests/test_ci_registration.py` and `tests/test_docs_links.py`: OK. - `tests/test_tool_stdout_encoding.py` fails in `test_every_main_block_reconfigures_stdout`, as on `main` `e18b59a5` alone (three tools this change does not touch). - `compileall`, `git diff --check` and `python -I scripts/check_no_game_data.py` on the two files: clean. Earlier head `56bed586`, rebased on `main` `28a32e19`; it merged cleanly with `main` `22372d86`. Same patch: only the `--timeout` help next to the new `--jobs` option conflicted. Windows 11, Python 3.12.4: - `python -I -B tests/test_run_wine_tests.py`: 74 run, 12 skipped, 1 error, in `test_jobs_runs_that_many_tests_at_a_time` (the run before also had one in `test_jobs_keeps_locks_serial_tests_and_dependencies`). Unmodified `main` `22372d86` gives the same errors (three runs: both twice, only the first named here once), so they do not come from this change. - `tests/test_tool_stdout_encoding.py`, `tests/test_docs_cli_flags.py` and `tests/test_text_write_line_endings.py`: OK. - `git diff --check` and `python -I -B scripts/check_no_game_data.py scripts/run_wine_tests.py tests/test_run_wine_tests.py`: clean. Earlier heads: - `c8e02cd4` (same patch as `743755d9`, on `main` `6293c1c4`), Windows 11, Python 3.12.4: `tests/test_run_wine_tests.py` 65 run, OK (9 skipped). - On `main` at `82a2aabc`, a synthetic passing test triggered `OverflowError` with `2147484` seconds on Debian WSL and `1e100` on Debian WSL and Windows. `2147483` completed on Debian. - The CLI now rejects both oversized values with exit 2. The focused tests check that no worker launches and that `2147483` completes a passing test. - `743755d9`: `python -I -B tests/test_run_wine_tests.py` on Windows, Python 3.12.4, 56 passed and 9 POSIX-only skips; `python3 -I -B tests/test_run_wine_tests.py` on Debian WSL, Python 3.11.2, 65 passed, and 67 after clean temporary merges with #999 (`e8226ee4`) and #919 (`3de809cf`); `tests/test_docs_cli_flags.py` 4 passed. GPUs tested: n/a (CPU-only synthetic tests). AI-assisted: yes (Codex; the rebases on `28a32e19` and `e18b59a5` with Claude Code). ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption.
KernelSmoker commented 2026-11-24 17:01:13 +00:00 (Migrated from github.com)

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

Review: APPROVED


Verified on exact head 743755d9a117682d8aa90f1ad3182a7d1250d9e5. python3 -I -B tests/test_run_wine_tests.py passes 65/65 on Python 3.15.2. Both changed files pass scripts/check_no_game_data.py, and git diff --check passes. I also checked the boundary directly: 2,147,483 seconds is accepted; 2,147,484, 1e100, NaN and infinity are rejected as argument errors. The focused regression ensures oversized values fail before launching a worker. Synthetic tests only; no Wine/Windows execution claimed.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6043765498 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1015#pullrequestreview-6043765498). Originally posted by [KernelSmoker](https://github.com/KernelSmoker) on 2026-11-24T17:01:13Z. **Review:** APPROVED --- Verified on exact head 743755d9a117682d8aa90f1ad3182a7d1250d9e5. `python3 -I -B tests/test_run_wine_tests.py` passes 65/65 on Python 3.15.2. Both changed files pass `scripts/check_no_game_data.py`, and `git diff --check` passes. I also checked the boundary directly: 2,147,483 seconds is accepted; 2,147,484, `1e100`, NaN and infinity are rejected as argument errors. The focused regression ensures oversized values fail before launching a worker. Synthetic tests only; no Wine/Windows execution claimed.
TheGeogeo commented 2026-11-24 21:22:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-24T21:22:33Z.


Rebased on main 6293c1c4: 743755d9 -> c8e02cd4, same patch (git range-diff). The previous base failed tests/test_tool_stdout_encoding.py, which #948 fixed on main, and the earlier CI run never started (action_required).

  • Windows 11, Python 3.12.4, after the rebase: tests/test_run_wine_tests.py 65 run, OK (9 skipped); test_tool_stdout_encoding.py, test_docs_cli_flags.py and test_text_write_line_endings.py OK; git diff --check and the no-game-data check clean.
  • The approval here was made before the rebase, on 743755d9.

No code change in this rebase. CI on the new head is still queued.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7144846696 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1015#issuecomment-7144846696). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-24T21:22:33Z. --- Rebased on `main` `6293c1c4`: `743755d9` -> `c8e02cd4`, same patch (`git range-diff`). The previous base failed `tests/test_tool_stdout_encoding.py`, which #948 fixed on `main`, and the earlier CI run never started (action_required). - Windows 11, Python 3.12.4, after the rebase: `tests/test_run_wine_tests.py` 65 run, OK (9 skipped); `test_tool_stdout_encoding.py`, `test_docs_cli_flags.py` and `test_text_write_line_endings.py` OK; `git diff --check` and the no-game-data check clean. - The approval here was made before the rebase, on `743755d9`. No code change in this rebase. CI on the new head is still queued. AI-assisted: yes (Claude Code).
TheGeogeo commented 2026-11-24 23:11:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-24T23:11:06Z.


Rebased on main 28a32e19, where #1354 (--jobs) conflicted: c8e02cd4 -> 56bed586, same patch; only the --timeout help next to the new --jobs option needed merging. It also merges cleanly with main 22372d86. KernelSmoker's approval was on 743755d9, before this and the previous rebase.

Windows 11, Python 3.12.4: tests/test_run_wine_tests.py 74 run, 12 skipped, errors only in test_jobs_runs_that_many_tests_at_a_time and, in one of two runs, test_jobs_keeps_locks_serial_tests_and_dependencies. Unmodified main 22372d86 has the same errors. test_tool_stdout_encoding.py, test_docs_cli_flags.py, test_text_write_line_endings.py, git diff --check and the no-game-data check pass.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7147110839 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1015#issuecomment-7147110839). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-24T23:11:06Z. --- Rebased on `main` `28a32e19`, where #1354 (`--jobs`) conflicted: `c8e02cd4` -> `56bed586`, same patch; only the `--timeout` help next to the new `--jobs` option needed merging. It also merges cleanly with `main` `22372d86`. KernelSmoker's approval was on `743755d9`, before this and the previous rebase. Windows 11, Python 3.12.4: `tests/test_run_wine_tests.py` 74 run, 12 skipped, errors only in `test_jobs_runs_that_many_tests_at_a_time` and, in one of two runs, `test_jobs_keeps_locks_serial_tests_and_dependencies`. Unmodified `main` `22372d86` has the same errors. `test_tool_stdout_encoding.py`, `test_docs_cli_flags.py`, `test_text_write_line_endings.py`, `git diff --check` and the no-game-data check pass.
TheGeogeo commented 2026-11-25 19:50:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-25T19:50:24Z.


Rebased from 56bed586 to b70bde27 on main e18b59a5, same patch (git range-diff). The old base was why test_ci_registration.py failed in this pull request's CI (test_sub_co_same_operand.py); it passes on the new base. KernelSmoker's approval was given on c8e02cd4, not on this head.

Windows 11, Python 3.12.4: test_run_wine_tests.py 74 run, 12 skipped, errors only in the two test_jobs_* cases, which main e18b59a5 alone gives too (both in two of three runs); test_ci_registration.py 16, test_ctest_registration.py 5, test_docs_links.py 16, test_docs_cli_flags.py and test_text_write_line_endings.py pass. Not from this change: test_tool_stdout_encoding.py fails on main alone as well, the two cs_dpp_cmp.asm cases of the old CI run are unchanged on main (not run here: no llvm-mc), and vk_xdxr_postbuild_readback still returns 77 without SKIP_RETURN_CODE on main (#1418).

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7172832512 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1015#issuecomment-7172832512). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-25T19:50:24Z. --- Rebased from `56bed586` to `b70bde27` on `main` `e18b59a5`, same patch (`git range-diff`). The old base was why `test_ci_registration.py` failed in this pull request's CI (`test_sub_co_same_operand.py`); it passes on the new base. KernelSmoker's approval was given on `c8e02cd4`, not on this head. Windows 11, Python 3.12.4: `test_run_wine_tests.py` 74 run, 12 skipped, errors only in the two `test_jobs_*` cases, which `main` `e18b59a5` alone gives too (both in two of three runs); `test_ci_registration.py` 16, `test_ctest_registration.py` 5, `test_docs_links.py` 16, `test_docs_cli_flags.py` and `test_text_write_line_endings.py` pass. Not from this change: `test_tool_stdout_encoding.py` fails on `main` alone as well, the two `cs_dpp_cmp.asm` cases of the old CI run are unchanged on `main` (not run here: no `llvm-mc`), and `vk_xdxr_postbuild_readback` still returns 77 without `SKIP_RETURN_CODE` on `main` (#1418). AI-assisted: yes (Claude Code)
OreoFR commented 2026-11-27 19:42:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-27T19:42:28Z.


Merge test and review, taken from the pool PRs MoonEyes had not checked yet. Main ec91d695c merged without conflict; the PR's test files run with the pins of tests/requirements.txt on Windows 11, Python 3.12 (venv). AI-assisted (Claude Code, Claude Opus 5.5).

  • Tests: with the PR the new tests pass; against main: 2 failed. The fix is shown.
  • NaN and inf are still rejected (not 0 < v <= MAX is true for both) and the existing nan/inf test passes. Nit: the error message reads oddly for nan.
  • One failure we saw, test_jobs_keeps_locks_serial_tests_and_dependencies (IndexError, tests/test_run_wine_tests.py:625), is timing-flaky on plain main too (1 in 4 runs on main, about the same with this PR): not caused by this PR.
  • Merges cleanly together with #999 and the merged tests pass.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7226791767 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1015#issuecomment-7226791767). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-27T19:42:28Z. --- Merge test and review, taken from the pool PRs MoonEyes had not checked yet. Main ec91d695c merged without conflict; the PR's test files run with the pins of `tests/requirements.txt` on Windows 11, Python 3.12 (venv). AI-assisted (Claude Code, Claude Opus 5.5). - **Tests:** with the PR the new tests pass; against main: 2 failed. The fix is shown. - NaN and inf are still rejected (`not 0 < v <= MAX` is true for both) and the existing nan/inf test passes. Nit: the error message reads oddly for nan. - One failure we saw, `test_jobs_keeps_locks_serial_tests_and_dependencies` (IndexError, `tests/test_run_wine_tests.py:625`), is timing-flaky on plain main too (1 in 4 runs on main, about the same with this PR): not caused by this PR. - Merges cleanly together with #999 and the merged tests pass.
MoonEyes commented 2026-11-28 19:34:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T19:34:42Z.


Red/green: tests/test_run_wine_tests.py fails 2 assertions on main (--timeout 2147484 and 1e100 are accepted and the test is launched) and passes with the PR (cloud run on main 7daa4a4).
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7244649259 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1015#issuecomment-7244649259). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T19:34:42Z. --- Red/green: tests/test_run_wine_tests.py fails 2 assertions on main (--timeout 2147484 and 1e100 are accepted and the test is launched) and passes with the PR (cloud run on main 7daa4a4). Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure. 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!1015
No description provided.