[PR #83] [MERGED] tests: pin the hardware threads where --jobs is asserted #136

Closed
opened 2026-11-26 20:16:54 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/83
Author: @wavehs
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism

Base: main ← Head: tests-win-pipelines-jobs


📝 Commits (1)

  • 67cbdf1 tests: pin the hardware threads where --jobs is asserted

📊 Changes

2 files changed (+8 additions, -2 deletions)

View changed files

📝 tests/test_make_game_argparse.py (+4 -1)
📝 tests/test_make_game_pipelines.py (+4 -1)

📄 Description

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.)

🔄 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/83 **Author:** [@wavehs](https://github.com/wavehs) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `tests-win-pipelines-jobs` --- ### 📝 Commits (1) - [`67cbdf1`](https://github.com/ubiquitarianism/leonida/commit/67cbdf11fafa76fbf863f23120c95e3d9c26375c) tests: pin the hardware threads where --jobs is asserted ### 📊 Changes **2 files changed** (+8 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_make_game_argparse.py` (+4 -1) 📝 `tests/test_make_game_pipelines.py` (+4 -1) </details> ### 📄 Description 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.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:16:54 +01:00
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#136
No description provided.