Skip to content

fix(test): stabilize flaky Windows CI tests#7

Merged
andylim-duo merged 3 commits into
mainfrom
fix/flaky-windows-ci-tests
Mar 17, 2026
Merged

fix(test): stabilize flaky Windows CI tests#7
andylim-duo merged 3 commits into
mainfrom
fix/flaky-windows-ci-tests

Conversation

@andylim-duo

Copy link
Copy Markdown
Owner

Summary

  • Process cleanup tests (test_stdio.py): Replace single-check file-growth assertions with polling loops inside anyio.fail_after(5) timeouts, so slow Windows CI runners get multiple attempts to observe that a process has stopped writing before failing
  • Command execution test (test_config.py): Increase subprocess.run() timeout from 20s to 60s for slow CI runners
  • In-memory transport test (test_memory.py): Add PytestUnraisableExceptionWarning filter on Windows alongside existing ResourceWarning filters, since TerminateProcess() prevents graceful transport cleanup and the resulting ResourceWarning gets wrapped in PytestUnraisableExceptionWarning

Closes #6

Test plan

  • All affected tests pass locally (pytest tests/client/test_stdio.py::TestChildProcessCleanup tests/client/test_config.py::test_command_execution tests/client/transports/test_memory.py::test_call_tool)
  • Linting and type checking pass
  • Verify Windows CI no longer shows intermittent failures in these tests

🤖 Generated with Claude Code

…ager, and PromptManager

Change internal storage from simple name-keyed dicts to composite
(tenant_id, name) keyed dicts, enabling the same resource name to exist
independently under different tenants.

All public methods gain a keyword-only `tenant_id: str | None = None`
parameter. Existing callers are unaffected — the default None scope
preserves backward compatibility with single-tenant usage.
On Windows CI runners, several tests fail intermittently due to timing
sensitivity and unhandled warnings from TerminateProcess() cleanup.

- Replace single-check file-growth assertions with polling loops inside
  anyio.fail_after(5) timeouts in process cleanup tests, so slow runners
  get multiple chances to observe the process has stopped
- Increase subprocess.run() timeout from 20s to 60s in test_command_execution
  to accommodate slow CI runners
- Add PytestUnraisableExceptionWarning filter on Windows alongside existing
  ResourceWarning filters, since Windows TerminateProcess() prevents graceful
  transport cleanup

Github-Issue:#6
@andylim-duo andylim-duo self-assigned this Mar 17, 2026
@andylim-duo andylim-duo added the testing We are having a problem with testing or CI pipeline label Mar 17, 2026
Add pragma: no branch to the polling loop conditionals in process
cleanup tests. These false branches (loop retry) are only exercised
on slow Windows CI runners and cannot be covered locally.

Github-Issue:#6
@andylim-duo andylim-duo merged commit 7f83ad4 into main Mar 17, 2026
26 checks passed
@andylim-duo andylim-duo deleted the fix/flaky-windows-ci-tests branch March 17, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing We are having a problem with testing or CI pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky Windows CI: subprocess teardown tests fail intermittently

1 participant