Skip to content

fix(test): handle Windows temp directory cleanup in integration tests#298

Merged
danielmeppiel merged 1 commit intomainfrom
fix/windows-tempdir-cleanup
Mar 14, 2026
Merged

fix(test): handle Windows temp directory cleanup in integration tests#298
danielmeppiel merged 1 commit intomainfrom
fix/windows-tempdir-cleanup

Conversation

@danielmeppiel
Copy link
Collaborator

Fix TemporaryDirectory WinError 32 cleanup failures. Add ignore_cleanup_errors=True and close stdout in finally.

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>
Copilot AI review requested due to automatic review settings March 14, 2026 12:14
@danielmeppiel danielmeppiel merged commit 6d4e192 into main Mar 14, 2026
14 checks passed
@danielmeppiel danielmeppiel deleted the fix/windows-tempdir-cleanup branch March 14, 2026 12:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.stdout in a finally block.

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.

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