mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:05:53 +01:00
[PR #322] tests: the make_game --jobs tests no longer depend on the host's core count #373
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#373
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/322
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:old-pr/10056📝 Commits (1)
809eca2tests: the make_game --jobs tests no longer depend on the host's core count📊 Changes
2 files changed (+26 additions, -4 deletions)
View changed files
📝
tests/test_make_game_argparse.py(+12 -2)📝
tests/test_make_game_pipelines.py(+14 -2)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):What
Three assertions in
tests/test_make_game_argparse.pyandtests/test_make_game_pipelines.pycompare a--jobsvalue thatmake_game.main()has already clamped to the host's CPU count (leonida_tui.clamp_jobs,make_game.py:2873). They therefore only pass on a machine with at least as many cores as the test asks for.This is a test-side fix only:
clamp_jobsandmake_game.pyare untouched.Why
On
mainde4c37383, withos.cpu_count()patched in-process (python -Iimplies-E, soPYTHON_CPU_COUNTnever reaches the test — the env-var shortcut does not reproduce this):test_make_game_pipelinestest_make_game_argparseAt 4 cpus:
4 and 3 are the sizes of the runners this repository's CI uses (
ubuntu-latesthas 4 cores,macos-26is the "three cores" ofci.yml), so both Python CI legs are red onmainfor this reason alone.Change
host_independent_jobs()helper that patchesleonida_tui.cpu_jobs_boundsto(1, 1, 1 << 30)— an upper bound no host reaches — around the calls that go throughmain().test_jobs_default_calculation_scenarios, which asserts the default computation directly and does not go throughmain().Tested
mainde4c37383+ this patch, both files,os.cpu_count()patched in-process:test_make_game_argparse.pytest_make_game_pipelines.pyclamp_jobsforced tomin(2, ...)— the three tests go red again at 4 cpus (2 argparse / 2 pipelines failures) and 16 cpus (3 / 3), so the pin does not make the assertions vacuous. Restored afterwards.python -m compileall -qon both files,python -I make_game.py --help: clean.AI-assisted (Hermes Agent). No game files.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.