@@ -28,7 +28,7 @@ async def test_notification_validation_error(tmp_path: Path):
2828
2929 server = Server (name = "test" )
3030 request_count = 0
31- slow_request = anyio .Event ()
31+ slow_request_lock = anyio .Event ()
3232
3333 @server .list_tools ()
3434 async def list_tools () -> list [types .Tool ]:
@@ -51,7 +51,7 @@ async def slow_tool(name: str, arg) -> Sequence[ContentBlock]:
5151 request_count += 1
5252
5353 if name == "slow" :
54- await slow_request .wait () # it should timeout here
54+ await slow_request_lock .wait () # it should timeout here
5555 return [TextContent (type = "text" , text = f"slow { request_count } " )]
5656 elif name == "fast" :
5757 return [TextContent (type = "text" , text = f"fast { request_count } " )]
@@ -82,15 +82,15 @@ async def client(read_stream, write_stream, scope):
8282 # First call should work (fast operation)
8383 result = await session .call_tool ("fast" )
8484 assert result .content == [TextContent (type = "text" , text = "fast 1" )]
85- assert not slow_request .is_set ()
85+ assert not slow_request_lock .is_set ()
8686
8787 # Second call should timeout (slow operation)
8888 with pytest .raises (McpError ) as exc_info :
8989 await session .call_tool ("slow" )
9090 assert "Timed out while waiting" in str (exc_info .value )
9191
92- # release the slow request not to have hagning process
93- slow_request .set ()
92+ # release the slow request not to have hanging process
93+ slow_request_lock .set ()
9494
9595 # Third call should work (fast operation),
9696 # proving server is still responsive
0 commit comments