Skip to content

Commit e63855c

Browse files
committed
fix: use simple sleep for server readiness, restore Windows parallelism
1 parent bc58720 commit e63855c

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

.github/workflows/run-tests.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,7 @@ jobs:
4848
run: uv sync --upgrade
4949

5050
- name: Run tests (excluding integration and client_process)
51-
run: |
52-
if [ "$RUNNER_OS" == "Windows" ]; then
53-
# Run without parallelism on Windows to debug xdist crashes
54-
uv run pytest --inline-snapshot=disable tests -m "not integration and not client_process"
55-
else
56-
uv run pytest --inline-snapshot=disable tests -m "not integration and not client_process" --numprocesses auto --maxprocesses 4 --dist worksteal
57-
fi
51+
run: uv run pytest --inline-snapshot=disable tests -m "not integration and not client_process" --numprocesses auto --maxprocesses 4 --dist worksteal
5852
shell: bash
5953

6054
- name: Run client process tests separately

src/fastmcp/utilities/tests.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,8 @@ async def test_greet(server: str):
212212
# Wait for server lifespan to be ready
213213
await server._started.wait()
214214

215-
# Wait for HTTP server to be ready by making a request
216-
url = f"http://{host}:{port}{path}"
217-
async with httpx.AsyncClient() as client:
218-
for _ in range(50): # 50 * 0.1s = 5s timeout
219-
try:
220-
await client.get(url, timeout=0.1)
221-
break
222-
except (httpx.ConnectError, httpx.TimeoutException):
223-
await asyncio.sleep(0.1)
215+
# Give uvicorn a moment to bind the port after lifespan is ready
216+
await asyncio.sleep(0.1)
224217

225218
try:
226219
yield f"http://{host}:{port}{path}"

0 commit comments

Comments
 (0)