Skip to content

Commit 093e5cc

Browse files
committed
test CI
1 parent bc1c986 commit 093e5cc

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

tests/issues/test_188_concurrency.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,26 @@
1212
async def test_messages_are_executed_concurrently():
1313
server = FastMCP("test")
1414
event = anyio.Event()
15-
tool_started = anyio.Event()
1615
call_order = []
1716

1817
@server.tool("sleep")
1918
async def sleep_tool():
2019
call_order.append("waiting_for_event")
21-
tool_started.set()
2220
await event.wait()
2321
call_order.append("tool_end")
2422
return "done"
2523

2624
@server.resource(_resource_name)
2725
async def slow_resource():
28-
# Wait for tool to start before setting the event
29-
await tool_started.wait()
26+
# Set event immediately
3027
event.set()
3128
call_order.append("resource_end")
3229
return "slow"
3330

3431
async with create_session(server._mcp_server) as client_session:
35-
# First tool will wait on event, second will set it
32+
# Start both requests concurrently
3633
async with anyio.create_task_group() as tg:
37-
# Start the tool first (it will wait on event)
3834
tg.start_soon(client_session.call_tool, "sleep")
39-
# Then the resource (it will set the event)
4035
tg.start_soon(client_session.read_resource, AnyUrl(_resource_name))
4136

4237
# Verify that both ran concurrently

0 commit comments

Comments
 (0)