Skip to content

fix(ci): test runner stops the pytest tree when taskkill writes to stderr - #110

Merged
Sekiph82 merged 2 commits into
mainfrom
fix/runner-taskkill-native-stderr
Dec 3, 2026
Merged

Sekiph82 merged 2 commits into
mainfrom
fix/runner-taskkill-native-stderr

Conversation

@Sekiph82

@Sekiph82 Sekiph82 commented Dec 3, 2026

Copy link
Copy Markdown
Owner

Root cause of the 4 failures in tests/ci/test_packlab_test_runner_behavior.py on main (owner machine).

  • tools/dev/run_packlab_tests.ps1 sets $ErrorActionPreference = "Stop". Under Windows PowerShell 5.1, 2>&1 on a native command turns its stderr into a terminating NativeCommandError.
  • Stop-PytestTree first runs a graceful taskkill /PID <pytest> /T. For a windowless console child, taskkill cannot close it gracefully and prints "could not be terminated" on stderr. The wrapper then aborted with exit 1 before the forced /F kill and before reporting the budget exit code (42/43/44).
  • Fix: a function-local $ErrorActionPreference = "Continue" in Stop-PytestTree, so the forced kill path runs. taskkill lines are still written to the log, as plain strings.

Evidence: before, pytest tests/ci/test_packlab_test_runner_behavior.py gave 1 failed and 2 passed with -x (4 fail without -x), with assert 1 == 42 and the NativeCommandError at line 230. After: 6 passed. No leftover contract processes or temp under %TEMP%\PackLab\runner-contract.

🤖 Generated with Claude Code

Sekiph82 and others added 2 commits December 4, 2026 01:27
…o stderr

Under Windows PowerShell 5.1 with $ErrorActionPreference = 'Stop', `2>&1` on a
native command turns its stderr into a terminating NativeCommandError. A graceful
`taskkill /T` that cannot close a windowless console child reports it on stderr,
so the wrapper aborted with exit 1 before the forced kill and before reporting
the budget code (tests/ci/test_packlab_test_runner_behavior.py: 4 failures on main).
Stop-PytestTree now uses a local 'Continue' preference; the forced kill path runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Sekiph82
Sekiph82 merged commit bb07c26 into main Dec 3, 2026
2 checks passed
@Sekiph82
Sekiph82 deleted the fix/runner-taskkill-native-stderr branch December 3, 2026 23:05
Sekiph82 added a commit that referenced this pull request Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant