diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 1cbb9cbd1b..89a225c3fe 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -53,7 +53,7 @@ jobs: - name: Run tests (excluding integration and client_process) run: | if [ "${{ matrix.os }}" == "windows-latest" ]; then - uv run pytest --inline-snapshot=disable tests -m "not integration and not client_process" + uv run pytest --inline-snapshot=disable tests -m "not integration and not client_process" -v else uv run pytest --inline-snapshot=disable tests -m "not integration and not client_process" --numprocesses auto --maxprocesses 4 --dist worksteal fi diff --git a/tests/test_mcp_config.py b/tests/test_mcp_config.py index 5a291d9d41..994e780626 100644 --- a/tests/test_mcp_config.py +++ b/tests/test_mcp_config.py @@ -33,6 +33,13 @@ ) from fastmcp.tools.tool import Tool as FastMCPTool +# Skip all tests in this file on Windows - they spawn subprocess servers via stdio +# which has process lifecycle issues on Windows +pytestmark = pytest.mark.skipif( + sys.platform.startswith("win32"), + reason="Windows has process lifecycle issues with stdio subprocesses", +) + def running_under_debugger(): return os.environ.get("DEBUGPY_RUNNING") == "true" @@ -243,10 +250,6 @@ def add(a: int, b: int) -> int: assert result_2.data == 3 -@pytest.mark.skipif( - sys.platform.startswith("win32"), - reason="Windows has process lifecycle issues with parallel stdio subprocess calls", -) async def test_multi_client_parallel_calls(tmp_path: Path): server_script = inspect.cleandoc(""" from fastmcp import FastMCP @@ -292,8 +295,8 @@ def add(a: int, b: int) -> int: @pytest.mark.skipif( - running_under_debugger() or sys.platform.startswith("win32"), - reason="Debugger holds a reference to the transport; Windows has process lifecycle issues", + running_under_debugger(), + reason="Debugger holds a reference to the transport", ) @pytest.mark.timeout(5) async def test_multi_client_lifespan(tmp_path: Path): @@ -357,10 +360,6 @@ def pid() -> int: await asyncio.sleep(0.01) -@pytest.mark.skipif( - sys.platform.startswith("win32"), - reason="Windows has process lifecycle issues", -) async def test_multi_client_force_close(tmp_path: Path): server_script = inspect.cleandoc(""" from fastmcp import FastMCP