From 2d4fd1d52f4884f3db60e5f662b5d057ddf301fc Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Tue, 7 Jul 2026 14:06:21 -0700 Subject: [PATCH] test(mcp): unblock recycle-reconnect test from the parked self-probe wait The salvaged test predates the parked-server self-probe (_PARKED_RETRY_INTERVAL, landed on main after the PR branched): after the final failed retry, run() parks in a real asyncio.wait that the patched asyncio.sleep doesn't cover, stalling the test 300s. Signal shutdown once the retry budget is exhausted so the park exits immediately. --- tests/tools/test_mcp_tool.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/tools/test_mcp_tool.py b/tests/tools/test_mcp_tool.py index a27baf5e79b..be41088e4eb 100644 --- a/tests/tools/test_mcp_tool.py +++ b/tests/tools/test_mcp_tool.py @@ -2158,6 +2158,13 @@ class TestReconnection: run_count += 1 if target_server is not self_srv: return await original_run_stdio(self_srv, config) + # After the final retry, run() parks in + # _wait_for_reconnect_or_shutdown(timeout=_PARKED_RETRY_INTERVAL) + # (a real asyncio.wait — the patched asyncio.sleep doesn't cover + # it). Signal shutdown so the park exits immediately instead of + # blocking the test for the 300s self-probe interval. + if run_count > _MAX_INITIAL_CONNECT_RETRIES: + self_srv._shutdown_event.set() raise ConnectionError("recycle reconnect failed") async def _test():