Repository navigation
fix(mcp-client): the real-child stdio tests spawn on a subprocess-capable loop (#692) - #951
Conversation
…able loop (#692) Windows run 38008915302 (job 114084097957) failed test_large_response_over_pipe_buffer_is_received and test_silent_child_raises_loud_timeout with "Failed to spawn: " and nothing after the colon. tests_py/conftest.py installs WindowsSelectorEventLoopPolicy on Windows, and a Windows SelectorEventLoop has no subprocess support: create_subprocess_exec raised a bare NotImplementedError, whose str() is "". The two tests now run on the Proactor loop on Windows (asyncio.new_event_loop elsewhere) and spawn sys.executable rather than a bare python3, which the python.org Windows installer does not provide. MCPClient formats the spawn error with repr(), so an exception with an empty message still names its type. Refs #692 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018kyZYtzRWPJiuHWAatwLCK
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @cdeust's task in 2m 35s —— View job PR #951 review complete
There are no Blockers and three Notes, none needed before merge. I could not run pytest, ruff or the craftsmanship gate here because those commands needed approval, so the review comes from reading the code. Nobody ran the tests on Windows. Verdict: approve |
Review 1 of 3: PR #951I found no Blockers. Five reviewers looked at the diff: code quality, documentation accuracy, performance, security and test coverage. What the reviewers confirmed by reading the code:
Not verified: the reviewers only read the code. I could not run pytest, ruff or the craftsmanship gate in this environment. When I checked, the Pipeline CI run was still in progress. Nobody exercised the Windows Proactor path. Notes, no action before merge
Verdict: approve |
|
Réponse aux trois notes non bloquantes de la revue 1. Aucune ne justifie à elle seule un push, qui relancerait la CI et la revue.
Generated by Claude Code |
Summary
Class 9 slice of #692, "mcp client spawn (2)". In Windows run 38008915302 (job 114084097957),
TestStdioDeadlockRegression::test_large_response_over_pipe_buffer_is_receivedand::test_silent_child_raises_loud_timeoutfailed withMcpConnectionError: Failed to spawn:, and nothing came after the colon.Root cause, from the traceback in the log.
tests_py/conftest.py:89-90installsWindowsSelectorEventLoopPolicyon Windows. A WindowsSelectorEventLoophas no subprocess support, sobase_events._make_subprocess_transportraised a bareNotImplementedError. Itsstr()is"", so the message printed bymcp_server/infrastructure/mcp_client.py:151hid the cause.Fix.
_run_with_subprocesses. On Windows it usesasyncio.ProactorEventLoop(), which is the Windows default and supports subprocesses. Elsewhere it usesasyncio.new_event_loop(). The global selector policy stays as it is, because the conftest documents why it is there._real_child_clientspawnssys.executableinstead of a barepython3, since the python.org Windows installer ships onlypython.exe. The allowlist gets both the full path and the basename, because_spawn_processcompares the last/component.MCPClientformats the spawn error withrepr(), so a bare exception still names its type (Failed to spawn: NotImplementedError()).Refs #692
Type of change
Test plan
pytest tests_py/infrastructure/test_mcp_client.py: 65 passed on Linux, Python 3.11.test_spawn_failure_with_an_empty_message_still_names_the_cause: it fails when{e!r}is reverted to{e}(checked locally: 1 failed) and passes with the fix.ruff checkandruff format --check(ruff 0.17.3, theuv.lockversion) on the changed files: OK.python scripts/check_craftsmanship.py: OK.Audit notes
_close_and_reapcloses the transport explicitly. That has not been observed on Windows either.torch.Coding-standards compliance
Reviewer checklist
Generated by Claude Code