fix(test): stabilize flaky Windows CI tests#7
Merged
Conversation
…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
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
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.
Summary
test_stdio.py): Replace single-check file-growth assertions with polling loops insideanyio.fail_after(5)timeouts, so slow Windows CI runners get multiple attempts to observe that a process has stopped writing before failingtest_config.py): Increasesubprocess.run()timeout from 20s to 60s for slow CI runnerstest_memory.py): AddPytestUnraisableExceptionWarningfilter on Windows alongside existingResourceWarningfilters, sinceTerminateProcess()prevents graceful transport cleanup and the resultingResourceWarninggets wrapped inPytestUnraisableExceptionWarningCloses #6
Test plan
pytest tests/client/test_stdio.py::TestChildProcessCleanup tests/client/test_config.py::test_command_execution tests/client/transports/test_memory.py::test_call_tool)🤖 Generated with Claude Code