Skip to content

Commit 9075335

Browse files
authored
Merge branch 'main' into ihrpr/fix-resource
2 parents 447d856 + 3fa7bc7 commit 9075335

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tests/issues/test_188_concurrency.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import anyio
22
import pytest
3-
from pydantic import AnyUrl
43

54
from mcp.server.fastmcp import FastMCP
65
from mcp.shared.memory import create_connected_server_and_client_session as create_session
76

8-
_resource_name = "slow://slow_resource"
9-
107

118
@pytest.mark.anyio
129
async def test_messages_are_executed_concurrently_tools():
@@ -64,7 +61,7 @@ async def sleep_tool():
6461
call_order.append("tool_end")
6562
return "done"
6663

67-
@server.resource(_resource_name)
64+
@server.resource("slow://slow_resource")
6865
async def slow_resource():
6966
# Wait for tool to start before setting the event
7067
await tool_started.wait()
@@ -78,7 +75,7 @@ async def slow_resource():
7875
# Start the tool first (it will wait on event)
7976
tg.start_soon(client_session.call_tool, "sleep")
8077
# Then the resource (it will set the event)
81-
tg.start_soon(client_session.read_resource, AnyUrl(_resource_name))
78+
tg.start_soon(client_session.read_resource, AnyUrl("slow://slow_resource"))
8279

8380
# Verify that both ran concurrently
8481
assert call_order == [

0 commit comments

Comments
 (0)