mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-06 09:28:34 +00:00
test: isolate MCP timeout regression from DNS
This commit is contained in:
parent
0eae7ceb1a
commit
e81968a32b
@ -656,11 +656,15 @@ async def test_connect_mcp_servers_streamable_http_uses_finite_timeout(
|
|||||||
async def _reachable(_url: str) -> bool:
|
async def _reachable(_url: str) -> bool:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def _validate(_url: str) -> tuple[bool, str]:
|
||||||
|
return True, ""
|
||||||
|
|
||||||
@asynccontextmanager
|
@asynccontextmanager
|
||||||
async def _capturing_streamable_http_client(_url: str, http_client=None):
|
async def _capturing_streamable_http_client(_url: str, http_client=None):
|
||||||
captured["timeout"] = http_client.timeout
|
captured["timeout"] = http_client.timeout
|
||||||
yield object(), object(), object()
|
yield object(), object(), object()
|
||||||
|
|
||||||
|
monkeypatch.setattr(mcp_mod, "validate_url_target", _validate)
|
||||||
monkeypatch.setattr(mcp_mod, "_probe_http_url", _reachable)
|
monkeypatch.setattr(mcp_mod, "_probe_http_url", _reachable)
|
||||||
monkeypatch.setattr(
|
monkeypatch.setattr(
|
||||||
sys.modules["mcp.client.streamable_http"],
|
sys.modules["mcp.client.streamable_http"],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user