Skip to content

Fix Windows test deadlock by removing aggressive defer cleanup#1138

Merged
ameowlia merged 1 commit into
developfrom
sidecar-codependency-bug
May 27, 2026
Merged

Fix Windows test deadlock by removing aggressive defer cleanup#1138
ameowlia merged 1 commit into
developfrom
sidecar-codependency-bug

Conversation

@geofffranks
Copy link
Copy Markdown
Contributor

The previous defer cleanup logic was causing test deadlocks on Windows:

  • defer functions were checking session.ExitCode() == -1 and calling Kill()
  • This interfered with natural process termination via session.Terminate()
  • Tests failed with "Expected process to exit. It did not."

Solution:

  • Remove aggressive defer cleanup from individual test cases
  • Rely on AfterEach cleanup for port management
  • Let processes exit naturally without interference
  • Keep cross-platform signal handling (Windows: 42, Unix: 143)

This allows Windows tests to pass while maintaining proper cleanup through the existing AfterEach hook and Serial execution.

Made-with: Cursor

Summary

Backward Compatibility

Breaking Change? Yes/No

The previous defer cleanup logic was causing test deadlocks on Windows:
- defer functions were checking session.ExitCode() == -1 and calling Kill()
- This interfered with natural process termination via session.Terminate()
- Tests failed with "Expected process to exit. It did not."

Solution:
- Remove aggressive defer cleanup from individual test cases
- Rely on AfterEach cleanup for port management
- Let processes exit naturally without interference
- Keep cross-platform signal handling (Windows: 42, Unix: 143)

This allows Windows tests to pass while maintaining proper cleanup
through the existing AfterEach hook and Serial execution.

Made-with: Cursor
@github-project-automation github-project-automation Bot moved this from Inbox to Pending Merge | Prioritized in Application Runtime Platform Working Group May 27, 2026
@ameowlia ameowlia merged commit ee6ad81 into develop May 27, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Done in Application Runtime Platform Working Group May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants