GPU-RUNNER-TEMP-ERROR: report temporary directory creation failures #1302
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!1302
Loading…
Reference in a new issue
No description provided.
Delete branch "gpu-runner-temp-error"
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 successfully merged and closed
Claimed in the coordination issue as: GPU-RUNNER-TEMP-ERROR
Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7145037818
When creating the default scratch directory fails, report the OS error, suggest a writable --work directory and exit with status 2 instead of a traceback. Explicit work directories still use the existing diagnostic. Temporary directories are still cleaned after the suite runs.
Verified on Windows: reproduced the uncaught PermissionError beforehand. After the fix, a mocked PermissionError returns 2, includes the OS error and --work hint, and does not start the suite. Also checked scratch cleanup for successful and failed suite returns. All 95 GPU runner unit tests and git diff --check passed. No GPU execution or game files required. AI-assisted (Codex).
#1302 | head e8960d3c58f0f998a19b0c9983110750ce5bebc6 (merged cleanly with main aa918e5d9f) |
python -I tests/test_run_gpu_tests.py+run_gpu_tests.main()tempfile.mkdtempOSErrorand--work ""probes | red on main: unhandledOSError: [Errno 28] No space left on devicewhentempfile.mkdtemp(prefix="leonida_gpu_tests_")fails beforetry:, and--work ""silently fell back totempfile.mkdtemp(...)(a.work or ...) while skippingfinally:cleanup (a.work is Nonewas false) | green on PR+main:75 ran, OK(test_run_gpu_tests.py),mkdtempfailure exits2witherror: cannot create a temporary GPU test directory: [Errno 28] No space left on device. Pass --work with a writable directory., and--work ""exits2witherror: cannot prepare GPU test directory : The system cannot find the path specified(no traceback, no leaked temp dir) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesAudited
scripts/run_gpu_tests.pyon Windows 11: movingif work is None: work = tempfile.mkdtemp(...)inside the guardedtry ... except OSErrorblock cleanly catches temporary-directory creation errors with exit code2and an actionable--workdiagnostic while also rejecting--work ""instead of leaking an uncleaned temporary directory. Also verifiedtests/test_ci_registration.pyandscripts/check_no_game_data.py.Checked
e8960d3c5merged (no commit) withmain87a39df94: Python 3.12.4, Windows 11 10.0.26300, CPU only.check_no_game_data.pyis clean.scripts/run_gpu_tests.pygive the same result onmainand on the merge (test_gpu_build_dir.py18 OK,test_gpu_blocked_program.py7 OK,test_f16_hw_words.py40 passed and 4 more).test_build_runtime_fallback.pyhas 1 failure onmaintoo.No blocker from my side.
AI-assisted (Claude Code).
Checked
e8960d3c5againstmain7c330c76d: Python 3.12.4, Windows 11 10.0.26300, CPU only.tests/test_run_gpu_tests.py, patchtempfile.mkdtempto raisePermissionErrorand callrun_gpu_tests.main()without--work. It should return 2, printcannot create a temporary GPU test directory, mention--work, and not start the suite. Onmainthe call is outside thetry, so thePermissionErrorescapes as a traceback.tests/test_run_gpu_tests.pygives 75 tests OK onmainand on the merge. The merge is clean, andcheck_no_game_data.pyis clean.AI-assisted (Claude Code).
Reviewed the diff against
main:scripts/run_gpu_tests.py:810-825cleanly catchesOSErroraroundtempfile.mkdtempas well asos.makedirsand returns exit code 2 with an actionable message suggesting--work. Clean-room verified. Approving; awaiting a green CI run before merge.(AI-assisted review.)