From e81968a32b3a14660e4cd819aa2ae53b86ae1b40 Mon Sep 17 00:00:00 2001 From: Xubin Ren <52506698+Re-bin@users.noreply.github.com> Date: Sat, 20 Jun 2026 19:12:36 +0800 Subject: [PATCH] test: isolate MCP timeout regression from DNS --- tests/tools/test_mcp_tool.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/tools/test_mcp_tool.py b/tests/tools/test_mcp_tool.py index 423d898d..b90fbddc 100644 --- a/tests/tools/test_mcp_tool.py +++ b/tests/tools/test_mcp_tool.py @@ -656,11 +656,15 @@ async def test_connect_mcp_servers_streamable_http_uses_finite_timeout( async def _reachable(_url: str) -> bool: return True + def _validate(_url: str) -> tuple[bool, str]: + return True, "" + @asynccontextmanager async def _capturing_streamable_http_client(_url: str, http_client=None): captured["timeout"] = http_client.timeout yield object(), object(), object() + monkeypatch.setattr(mcp_mod, "validate_url_target", _validate) monkeypatch.setattr(mcp_mod, "_probe_http_url", _reachable) monkeypatch.setattr( sys.modules["mcp.client.streamable_http"],