fix(test): handle Windows temp directory cleanup in integration tests#298
Merged
danielmeppiel merged 1 commit intomainfrom Mar 14, 2026
Merged
fix(test): handle Windows temp directory cleanup in integration tests#298danielmeppiel merged 1 commit intomainfrom
danielmeppiel merged 1 commit intomainfrom
Conversation
TemporaryDirectory context manager fails on Windows when subprocesses still hold file locks. Use ignore_cleanup_errors=True (Python 3.10+) and close Popen stdout in finally block to release handles. Same WinError 32 pattern as the auto-install teardown fix (#295). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the reliability of Windows E2E/integration tests by reducing temporary-directory cleanup failures (notably WinError 32) and ensuring subprocess output pipes are properly closed.
Changes:
- Use
tempfile.TemporaryDirectory(ignore_cleanup_errors=True)in E2E tests to avoid failing on Windows cleanup file-lock issues. - In the guardrailing hero E2E test, increase graceful termination wait time and close
process.stdoutin afinallyblock.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/integration/test_mcp_registry_e2e.py |
Updates multiple TemporaryDirectory() usages to ignore cleanup errors during teardown on Windows. |
tests/integration/test_guardrailing_hero_e2e.py |
Makes workspace temp cleanup more resilient; increases subprocess termination wait and closes stdout pipe reliably. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix TemporaryDirectory WinError 32 cleanup failures. Add ignore_cleanup_errors=True and close stdout in finally.