Jeremiah Lowin commited on
Commit
f05b838
·
1 Parent(s): f9290cf

Try expanding timeout because test error

Browse files
tests/client/test_streamable_http.py CHANGED
@@ -138,16 +138,16 @@ class TestTimeout:
138
  with pytest.raises(McpError, match="Timed out"):
139
  async with Client(
140
  transport=StreamableHttpTransport(streamable_http_server),
141
- timeout=0.01,
142
  ) as client:
143
- await client.call_tool("sleep", {"seconds": 0.1})
144
 
145
  async def test_timeout_tool_call(self, streamable_http_server: str):
146
  async with Client(
147
  transport=StreamableHttpTransport(streamable_http_server),
148
  ) as client:
149
  with pytest.raises(McpError):
150
- await client.call_tool("sleep", {"seconds": 0.1}, timeout=0.01)
151
 
152
  async def test_timeout_tool_call_overrides_client_timeout(
153
  self, streamable_http_server: str
@@ -157,7 +157,7 @@ class TestTimeout:
157
  timeout=2,
158
  ) as client:
159
  with pytest.raises(McpError):
160
- await client.call_tool("sleep", {"seconds": 0.1}, timeout=0.01)
161
 
162
  async def test_timeout_client_timeout_overrides_tool_call_timeout_if_lower(
163
  self, streamable_http_server: str
@@ -165,6 +165,6 @@ class TestTimeout:
165
  with pytest.raises(McpError):
166
  async with Client(
167
  transport=StreamableHttpTransport(streamable_http_server),
168
- timeout=0.01,
169
  ) as client:
170
- await client.call_tool("sleep", {"seconds": 0.1}, timeout=2)
 
138
  with pytest.raises(McpError, match="Timed out"):
139
  async with Client(
140
  transport=StreamableHttpTransport(streamable_http_server),
141
+ timeout=0.1,
142
  ) as client:
143
+ await client.call_tool("sleep", {"seconds": 0.2})
144
 
145
  async def test_timeout_tool_call(self, streamable_http_server: str):
146
  async with Client(
147
  transport=StreamableHttpTransport(streamable_http_server),
148
  ) as client:
149
  with pytest.raises(McpError):
150
+ await client.call_tool("sleep", {"seconds": 0.2}, timeout=0.1)
151
 
152
  async def test_timeout_tool_call_overrides_client_timeout(
153
  self, streamable_http_server: str
 
157
  timeout=2,
158
  ) as client:
159
  with pytest.raises(McpError):
160
+ await client.call_tool("sleep", {"seconds": 0.2}, timeout=0.1)
161
 
162
  async def test_timeout_client_timeout_overrides_tool_call_timeout_if_lower(
163
  self, streamable_http_server: str
 
165
  with pytest.raises(McpError):
166
  async with Client(
167
  transport=StreamableHttpTransport(streamable_http_server),
168
+ timeout=0.1,
169
  ) as client:
170
+ await client.call_tool("sleep", {"seconds": 0.2}, timeout=2)