Skip to content

Fix Windows crash hooks and process output capture - #4

Open
JusterZhu wants to merge 2 commits into
mainfrom
justerzhu-bowl-windows-hooks
Open

JusterZhu wants to merge 2 commits into
mainfrom
justerzhu-bowl-windows-hooks

Conversation

@JusterZhu

@JusterZhu JusterZhu commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Execute the fixed Windows hook as .\on-crash.cmd so it does not depend on command lookup searching the working directory; report nonzero exit codes as warnings.
  • Wait for stdout and stderr to drain after process exit before returning captured output, while retaining timeout and cancellation bounds. This addresses the intermittent Windows CI failure in ProcessRunnerTests.RunAsync_ResultHasOutputLines.
  • Cover hook environment isolation and paths with spaces and &, and repeatedly verify both output streams are captured completely. Update the migration integrity snapshot for the intentional changes.

Verification

  • Reproduced the hook failure with NoDefaultCurrentDirectoryInExePath=1; the original implementation passed when the setting was removed. The strengthened hook regression failed before the fix and passed afterward.
  • Windows: dotnet build Bowl.slnx -c Release and dotnet test Bowl.slnx -c Release --no-build (236 passed).
  • Windows: scripts\Verify-Migration.ps1 and dotnet pack src\GeneralUpdate.Bowl\GeneralUpdate.Bowl.csproj -c Release --no-build.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 22, 2026 14:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the Windows crash-hook changes.

No open issues 🎉

What changed in this PR

This PR fixes Windows crash-hook execution in the watchdog when current-directory command lookup is disabled.

Changes:

  • Invoke the Windows hook explicitly as .\on-crash.cmd.
  • Log nonzero hook exit codes as warnings.
  • Strengthen concurrent-hook regression coverage with restricted command lookup and paths containing spaces and &, while isolating environment changes from parallel tests.
File Description
tests/​Bowl.Console.Tests/​WatcherTests.cs Strengthens hook regression coverage and restores the modified environment setting after testing.
src/​GeneralUpdate.Bowl.Console/​SupervisorLoop.cs Uses an explicit relative Windows hook path, warns on nonzero exits, and cleans up the method comment.

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@JusterZhu JusterZhu changed the title Fix Windows crash hook execution when current-directory search is disabled Fix Windows crash hooks and process output capture Nov 22, 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.

2 participants