Retry the dev-server start when a worker misses the bridge's five-second connect window - #14
Merged
Merged
Conversation
…ond connect window Every xdist worker starts its own Temporal dev server. On a cold Windows runner the binary can take longer than the fixed five seconds the SDK bridge waits, and the session fixture then fails with "Failed starting Temporal dev server ... ConnectionRefused" in two or three workers while the rest pass (PR #13, run 34504784871: 213 passed, 2 setup errors). Retry that specific failure up to three times before giving up.
brianstrauch
approved these changes
Sep 11, 2026
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
Every xdist worker starts its own Temporal dev server through
WorkflowEnvironment.start_local. The SDK bridge waits a fixed five seconds for the server to accept connections; on a cold Windows runner the binary can take longer than that, and the session fixture then fails withFailed starting Temporal dev server ... ConnectionRefusedin two or three workers while the other workers pass. PR #13's run 34504784871 hit it onwindows-latest, py3.14: 213 passed, 2 setup errors, unrelated to the PR's content.The
envfixture now retries that specific failure up to three times before giving up. Any other startup error still surfaces on the first attempt.tests/conftest.pyis an adaptation file (AGENTS.md, "Transition rules"), not an imported one. The same change belongs inpython/mcp/tests/conftest.pyonce #5 has merged.Testing
make lintcleanmake test PYTEST_ARGS="-k 'test_hello_world_agent or test_tool_workflow'": 2 passed (the two tests that errored in the failing run)