Skip to content

Commit bd73448

Browse files
committed
set read_timeout_seconds to avoid test blocking for ever in case something fails
1 parent f96aaa5 commit bd73448

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/shared/test_session.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from collections.abc import AsyncGenerator
2+
from datetime import timedelta
23

34
import anyio
45
import pytest
@@ -165,7 +166,11 @@ async def handle_list_tools() -> list[types.Tool]:
165166
async def make_request(client_session: ClientSession):
166167
nonlocal ev_cancelled
167168
try:
168-
await client_session.call_tool("slow_tool", cancellable=False)
169+
await client_session.call_tool(
170+
"slow_tool",
171+
cancellable=False,
172+
read_timeout_seconds=timedelta(seconds=10),
173+
)
169174
except McpError:
170175
pytest.fail("Request should not have been cancelled")
171176

0 commit comments

Comments
 (0)