Skip to content

Commit 5e77e28

Browse files
committed
merge with recent branch
1 parent a7a7a43 commit 5e77e28

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/server/fastmcp/test_integration.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from collections.abc import Generator
1313
from typing import Any
1414

15+
import anyio
1516
import pytest
1617
import uvicorn
1718
from pydantic import AnyUrl, BaseModel, Field
@@ -812,6 +813,13 @@ async def progress_callback(progress: float, total: float | None, message: str |
812813
params,
813814
progress_callback=progress_callback,
814815
)
816+
# Progress notifications may arrive slightly after the tool result is
817+
# received, so wait briefly to ensure all updates are processed.
818+
if len(progress_updates) < steps:
819+
for _ in range(5):
820+
await anyio.sleep(0.05)
821+
if len(progress_updates) == steps:
822+
break
815823
assert len(tool_result.content) == 1
816824
assert isinstance(tool_result.content[0], TextContent)
817825
assert f"Processed '{test_message}' in {steps} steps" in tool_result.content[0].text

0 commit comments

Comments
 (0)