Skip timeout tests on windows

This commit is contained in:
Jeremiah Lowin 2025-05-20 09:33:17 -04:00
commit a0e69a4cb2
3 changed files with 13 additions and 8 deletions

View file

@ -1,4 +1,5 @@
import asyncio
import sys
from typing import cast
import pytest
@ -509,6 +510,10 @@ class TestErrorHandling:
assert "This is a resource error (xyz)" in str(excinfo.value)
@pytest.mark.skipif(
sys.platform == "win32",
reason="Timeout tests are flaky on Windows. Timeouts *are* supported but the tests are unreliable.",
)
class TestTimeout:
async def test_timeout(self, fastmcp_server: FastMCP):
async with Client(

View file

@ -136,11 +136,11 @@ async def test_nested_sse_server_resolves_correctly():
assert result is True
@pytest.mark.skipif(
sys.platform == "win32",
reason="Timeout tests are flaky on Windows. Timeouts *are* supported but the tests are unreliable.",
)
class TestTimeout:
@pytest.mark.skipif(
sys.platform == "win32",
reason="This test is flaky on Windows. Sometimes the client timeout is respected and sometimes it is not.",
)
async def test_timeout(self, sse_server: str):
with pytest.raises(
McpError,
@ -167,10 +167,6 @@ class TestTimeout:
with pytest.raises(McpError, match="Timed out"):
await client.call_tool("sleep", {"seconds": 0.1}, timeout=0.01)
@pytest.mark.skipif(
sys.platform == "win32",
reason="This test is flaky on Windows. Sometimes the client timeout is respected and sometimes it is not.",
)
async def test_timeout_client_timeout_does_not_override_tool_call_timeout_if_lower(
self, sse_server: str
):

View file

@ -149,6 +149,10 @@ async def test_nested_streamable_http_server_resolves_correctly():
assert result is True
@pytest.mark.skipif(
sys.platform == "win32",
reason="Timeout tests are flaky on Windows. Timeouts *are* supported but the tests are unreliable.",
)
class TestTimeout:
async def test_timeout(self, streamable_http_server: str):
# note this transport behaves differently than others and raises