[PR #1002] test_build_batch_launch: read the batch's exit code after it has exited (TEST-BATCH-LAUNCH-EXITCODE) #1039

Open
opened 2026-11-26 20:19:53 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1002
Author: @Snooozs
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: batch-launch-exitcode


📝 Commits (1)

  • e61fdab TEST-BATCH-LAUNCH-EXITCODE: read the batch exit code after the child exits

📊 Changes

1 file changed (+5 additions, -3 deletions)

View changed files

📝 tests/test_build_batch_launch.py (+5 -3)

📄 Description

Claimed in the coordination issue as: TEST-BATCH-LAUNCH-EXITCODE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7137887651)

What and why

tests/test_build_batch_launch.py fails on this Windows 10 PC: the helper starts cmd.exe with -PassThru, takes $p.Handle and reads $p.ExitCode after WaitForExit(). The stub batch has already exited by then, so ExitCode is usually null (28 of 30 runs) and exit $p.ExitCode turns it into 0.

The helper now uses -Wait -PassThru. A null code is reported as 999, which no case expects. The parsed production -ArgumentList expression, the folder cases and the negative control (a launch line that drops the quotes) are unchanged.

Production scripts are untouched: with their pattern and a child that lives about 2 s, ExitCode was correct in 20 of 20 runs.

Trade-off: the file takes about 56 s here instead of 20 s, because -Wait adds time to each start.

Tested

Windows 10 Pro 22H2 (19045), Windows PowerShell 5.1, CPython 3.12.10:

  • before: Ran 2 tests ... FAILED (failures=3)
  • after: OK in five runs, and once more after the rebase
  • compileall, test_text_write_line_endings, check_no_game_data.py: clean

GPUs tested: n/a

AI-assisted: yes. Claude Code (a Haiku 5.5 subagent found the cause and wrote the change, Claude Opus 5.5 reviewed it and reran the tests).

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • 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. (n/a: no translator rule)

🤖 Generated with Claude Code


🔄 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/1002 **Author:** [@Snooozs](https://github.com/Snooozs) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `batch-launch-exitcode` --- ### 📝 Commits (1) - [`e61fdab`](https://github.com/ubiquitarianism/leonida/commit/e61fdab8d2c8272b9287a0887ba198a404ef1dc4) TEST-BATCH-LAUNCH-EXITCODE: read the batch exit code after the child exits ### 📊 Changes **1 file changed** (+5 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_build_batch_launch.py` (+5 -3) </details> ### 📄 Description Claimed in the coordination issue as: TEST-BATCH-LAUNCH-EXITCODE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7137887651) ### What and why `tests/test_build_batch_launch.py` fails on this Windows 10 PC: the helper starts `cmd.exe` with `-PassThru`, takes `$p.Handle` and reads `$p.ExitCode` after `WaitForExit()`. The stub batch has already exited by then, so ExitCode is usually null (28 of 30 runs) and `exit $p.ExitCode` turns it into 0. The helper now uses `-Wait -PassThru`. A null code is reported as 999, which no case expects. The parsed production `-ArgumentList` expression, the folder cases and the negative control (a launch line that drops the quotes) are unchanged. Production scripts are untouched: with their pattern and a child that lives about 2 s, ExitCode was correct in 20 of 20 runs. Trade-off: the file takes about 56 s here instead of 20 s, because `-Wait` adds time to each start. ### Tested Windows 10 Pro 22H2 (19045), Windows PowerShell 5.1, CPython 3.12.10: - before: `Ran 2 tests ... FAILED (failures=3)` - after: OK in five runs, and once more after the rebase - `compileall`, `test_text_write_line_endings`, `check_no_game_data.py`: clean GPUs tested: n/a AI-assisted: yes. Claude Code (a Haiku 5.5 subagent found the cause and wrote the change, Claude Opus 5.5 reviewed it and reran the tests). ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator rule) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#1039
No description provided.