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.
This commit is contained in:
teknium1 2026-07-07 14:06:21 -07:00 committed by Teknium
parent a6203839b4
commit 2d4fd1d52f

View file

@ -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():