Skip to content

Commit bc1c986

Browse files
committed
fix order for 188 test
1 parent 717c626 commit bc1c986

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/issues/test_188_concurrency.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,21 @@
1212
async def test_messages_are_executed_concurrently():
1313
server = FastMCP("test")
1414
event = anyio.Event()
15+
tool_started = anyio.Event()
1516
call_order = []
1617

1718
@server.tool("sleep")
1819
async def sleep_tool():
1920
call_order.append("waiting_for_event")
21+
tool_started.set()
2022
await event.wait()
2123
call_order.append("tool_end")
2224
return "done"
2325

2426
@server.resource(_resource_name)
2527
async def slow_resource():
28+
# Wait for tool to start before setting the event
29+
await tool_started.wait()
2630
event.set()
2731
call_order.append("resource_end")
2832
return "slow"

0 commit comments

Comments
 (0)