@@ -28,7 +28,7 @@ async def test_notification_validation_error(tmp_path: Path):
28
28
29
29
server = Server (name = "test" )
30
30
request_count = 0
31
- slow_request = anyio .Event ()
31
+ slow_request_lock = anyio .Event ()
32
32
33
33
@server .list_tools ()
34
34
async def list_tools () -> list [types .Tool ]:
@@ -51,7 +51,7 @@ async def slow_tool(name: str, arg) -> Sequence[ContentBlock]:
51
51
request_count += 1
52
52
53
53
if name == "slow" :
54
- await slow_request .wait () # it should timeout here
54
+ await slow_request_lock .wait () # it should timeout here
55
55
return [TextContent (type = "text" , text = f"slow { request_count } " )]
56
56
elif name == "fast" :
57
57
return [TextContent (type = "text" , text = f"fast { request_count } " )]
@@ -82,15 +82,15 @@ async def client(read_stream, write_stream, scope):
82
82
# First call should work (fast operation)
83
83
result = await session .call_tool ("fast" )
84
84
assert result .content == [TextContent (type = "text" , text = "fast 1" )]
85
- assert not slow_request .is_set ()
85
+ assert not slow_request_lock .is_set ()
86
86
87
87
# Second call should timeout (slow operation)
88
88
with pytest .raises (McpError ) as exc_info :
89
89
await session .call_tool ("slow" )
90
90
assert "Timed out while waiting" in str (exc_info .value )
91
91
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 ()
94
94
95
95
# Third call should work (fast operation),
96
96
# proving server is still responsive
0 commit comments