tests: pin the hardware threads where --jobs is asserted #83

Manually merged
github merged 1 commit from gh-pr/83/head into gh-pr/83/base 2026-11-26 08:43:42 +00:00
Owner

@⁠wavehs on GitHub · 2026-11-24 02:14 UTC · original
wavehs:tests-win-pipelines-jobs → main · +8 −2 · 2 files · 1 commits · merged 2026-11-24 03:10 UTC

Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository's issue index (#18) has no entry for it.

Depends on: none (the --jobs 10 assets case, the same clamp in a sibling test, is already on main).

What and why

main() clamps --jobs with leonida_tui.clamp_jobs, whose ceiling is os.cpu_count(). The GitHub Windows runner has four hardware threads, so two cases that ask for more see the clamp:

FAIL: test_custom_jobs_forwarded_to_shaders
AssertionError: expected call not found.
Expected: preflight(['shaders'], ..., jobs=6)
Actual:   preflight(['shaders'], ..., jobs=4)

FAIL: test_jobs_on_the_command_line_reach_the_checker (tests/test_make_game_pipelines.py:59)
AssertionError: '4' != '5'

Both now pin cpu_count at 16 for that call, as the --jobs 10 assets case already does on main (it was the third failure in this file). The default-jobs case is left alone, so it still checks the real count's halving.

Tested

main@e09a55529, macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2, CPU only, no game files:

tree 12 threads (this host) 4 threads (os.cpu_count patched, the Windows runner)
main@e09a55529 OK (skipped=1) FAILED (failures=2) — the two above
this commit OK (skipped=1) OK (skipped=1)

Both files run together in the 4-thread check. compileall clean, check_no_game_data.py clean. Not run: Windows, any GPU test.

Note: old PR 10056 (old-pr/10056, BlackNife) reworks the same two files for the same reason; I said so in a comment here, and whichever lands first the other can be dropped.

AI-assisted: yes.

Checklist

  • 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. (Not applicable: test-only.)
**@⁠wavehs** on GitHub · 2026-11-24 02:14 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/83) `wavehs:tests-win-pipelines-jobs` → `main` · +8 −2 · 2 files · 1 commits · merged 2026-11-24 03:10 UTC Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository's issue index (#18) has no entry for it. Depends on: none (the `--jobs 10` assets case, the same clamp in a sibling test, is already on `main`). ### What and why `main()` clamps `--jobs` with `leonida_tui.clamp_jobs`, whose ceiling is `os.cpu_count()`. The GitHub Windows runner has four hardware threads, so two cases that ask for more see the clamp: ``` FAIL: test_custom_jobs_forwarded_to_shaders AssertionError: expected call not found. Expected: preflight(['shaders'], ..., jobs=6) Actual: preflight(['shaders'], ..., jobs=4) FAIL: test_jobs_on_the_command_line_reach_the_checker (tests/test_make_game_pipelines.py:59) AssertionError: '4' != '5' ``` Both now pin `cpu_count` at 16 for that call, as the `--jobs 10` assets case already does on `main` (it was the third failure in this file). The default-jobs case is left alone, so it still checks the real count's halving. ### Tested `main@e09a55529`, macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2, CPU only, no game files: | tree | 12 threads (this host) | 4 threads (`os.cpu_count` patched, the Windows runner) | |---|---|---| | `main@e09a55529` | `OK (skipped=1)` | `FAILED (failures=2)` — the two above | | this commit | `OK (skipped=1)` | `OK (skipped=1)` | Both files run together in the 4-thread check. `compileall` clean, `check_no_game_data.py` clean. Not run: Windows, any GPU test. Note: old PR 10056 (`old-pr/10056`, BlackNife) reworks the same two files for the same reason; I said so in a comment here, and whichever lands first the other can be dropped. AI-assisted: yes. ### Checklist - [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. (Not applicable: test-only.)
main() clamps --jobs to os.cpu_count(), and the GitHub Windows runners have
four, so --jobs 6 reached the shaders stage as 4 and --jobs 5 reached the
pipeline checker as 4 ('4' != '5'). Both cases pin cpu_count at 16 for the
call, as the merged --jobs 10 assets case does; the default case keeps
reading the real count.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:43:40 +00:00
github manually merged commit 67cbdf11fa into gh-pr/83/base 2026-11-26 08:43:42 +00:00
Author
Owner

@⁠wavehs on GitHub · 2026-11-24 02:27 UTC · original

Heads-up for whoever merges the re-landed old pull requests: old PR 10056 (old-pr/10056, BlackNife, "tests: the make_game --jobs tests no longer depend on the host's core count") covers the same two files, tests/test_make_game_argparse.py (both test_custom_jobs_forwarded_to_* cases, which #1 fixes only for assets) and this one. Whichever lands first, the other can be dropped - mine pins cpu_count for the one call, 10056 reworks the cases; the outcome for the Windows runner is the same (--jobs no longer clamped to 4 in the expectation).

**@⁠wavehs** on GitHub · 2026-11-24 02:27 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/83#issuecomment-7120156443) Heads-up for whoever merges the re-landed old pull requests: old PR 10056 (`old-pr/10056`, BlackNife, "tests: the make_game --jobs tests no longer depend on the host's core count") covers the same two files, `tests/test_make_game_argparse.py` (both `test_custom_jobs_forwarded_to_*` cases, which #1 fixes only for assets) and this one. Whichever lands first, the other can be dropped - mine pins `cpu_count` for the one call, 10056 reworks the cases; the outcome for the Windows runner is the same (`--jobs` no longer clamped to 4 in the expectation).
This discussion has been locked. Commenting is limited to contributors.
No description provided.