tests: the quick-program GPU timeout case no longer races Python startup (TEST-GPU-TIMEOUT-QUICK-LOAD) #1427
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1427"
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?
Imported from ubiquitarianism/leonida. Originally posted by Anonymous78e on 2026-11-25T00:01:05Z.
Claimed in the coordination issue as: TEST-GPU-TIMEOUT-QUICK-LOAD (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7147985597)
What and why
tests/test_gpu_test_timeout.pyHungProgram.test_quick_program_is_unaffectedruns a quick child,python -c "print('ok')", throughrun_gpu_tests.run_cmdandcheck.rununder the class'sLEONIDA_GPU_TEST_TIMEOUT=0.5. That limit is meant for the hang cases. On a loaded Windows host, starting a Python child alone can take longer than 0.5 s, so the quick program is killed and the test fails for the wrong reason:It passes alone. I first saw it in a full parallel run of
tests/, and it is not one of the three in the parallel-load finding of the coordination issue (#1410 covers thetiming.logone).This case now runs under a 60 s limit. That is still a limit, and the test asserts
check.gpu_test_timeout()is 60, so it keeps checking that a limit in force leaves a quick program alone. The hang cases keep 0.5 s, andtest_translator_step_has_no_limitstill checks that 0.5 is passed through.Tested
Windows 11 Pro 26H2, CPython 3.13.15, 16 threads, with the CPU saturated by 64 busy processes, on
main6fe83805a:test_quick_program_is_unaffectedalonemainUnloaded,
python -I tests/test_gpu_test_timeout.pyruns 8 tests OK.scripts/check_no_game_data.pyon the file: clean.GPUs tested: n/a (no GPU involved; the hang is a sleeping Python child)
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
https://claude.ai/code/session_014sDZDAAcsauTL6d8ie67Qo
Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T10:37:06Z.
Reviewed
7a6eb36: Ranpython3 -I tests/test_gpu_test_timeout.pyin the sandbox on main and on thisbranch (8 tests, OK on both, no GPU needed) and reproduced the reported race: with 60 CPU spinners on
2 cores, main's quick-program case fails because the child is killed by the 0.5 s limit
(
(1, 'timed out after 0.5 s: ...') != (0, 'ok')), while this branch passes (60 s limit, 0.93 sunder the same load). No findings; the hang cases keep 0.5 s. AI-assisted review.
Recommendation: Merge
Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T08:03:27Z.
Merged into
main(merge commit11f6138b8), approved by DadaCap (maintainer). Thanks!Checked before merging: Tested in our local release candidate (main + 41 PRs): translator suite 512 files / 6,442 tests clean, Python suite with no new failure versus main, and 360 s game runs on an RTX 5080 with no regression. The merge was pinned to the head commit that was tested (
7a6eb36b6).AI-assisted (Claude Code), posted for DadaCap.