Skip to content

test: preserve child exit codes on Windows PowerShell 5.1 - #192

Open
qtcqtc wants to merge 1 commit into
monk-io:mainfrom
qtcqtc:fix/windows-readiness-test-exitcode
Open

test: preserve child exit codes on Windows PowerShell 5.1#192
qtcqtc wants to merge 1 commit into
monk-io:mainfrom
qtcqtc:fix/windows-readiness-test-exitcode

Conversation

@qtcqtc

@qtcqtc qtcqtc commented Jul 30, 2026

Copy link
Copy Markdown

Closes #191.

Windows PowerShell 5.1 returns a null ExitCode for a Start-Process -PassThru child when stdout and stderr are redirected. That makes the readiness-timeout regression test fail even though the launcher exits with the expected status and diagnostic.

This change:

  • starts the launcher through System.Diagnostics.ProcessStartInfo, which preserves the child exit code on Windows PowerShell 5.1 and PowerShell 7;
  • reads stdout/stderr asynchronously to avoid pipe deadlocks;
  • terminates the fake never-ready companion before collecting output, because it inherits the redirected handles;
  • keeps the existing 15-second process bound and 10-second elapsed-time assertion.

Verified on Windows 11 / Windows PowerShell 5.1:

Windows block-monk fallback tests passed.
readiness_timeout_status=pass elapsed=4.54s

git diff --check also passes.

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.

[Bug bounty] Windows PowerShell 5.1 readiness test loses child exit code

1 participant