Widen the stdio round-trip test's termination grace and overall timeout (#2880)
This commit is contained in:
@@ -61,8 +61,10 @@ async def test_tool_call_and_notification_round_trip_over_a_stdio_subprocess(
|
||||
# post-print kill can no longer silently lose the data file -- see _stdio_server.main). The
|
||||
# production 2s default is too tight for the unwind+save tail on loaded Windows runners
|
||||
# (measured in-situ p99 of the whole test is ~7s); a kill before the print fails the stderr
|
||||
# assertion below loudly rather than tripping the coverage gate. Not under test.
|
||||
monkeypatch.setattr(stdio, "PROCESS_TERMINATION_TIMEOUT", 10.0)
|
||||
# assertion below loudly rather than tripping the coverage gate. The 20s grace covers even a
|
||||
# badly starved runner (a >10s stall has been seen once in CI) and costs nothing when the
|
||||
# child exits promptly. Not under test.
|
||||
monkeypatch.setattr(stdio, "PROCESS_TERMINATION_TIMEOUT", 20.0)
|
||||
|
||||
received: list[LoggingMessageNotificationParams] = []
|
||||
|
||||
@@ -85,8 +87,8 @@ async def test_tool_call_and_notification_round_trip_over_a_stdio_subprocess(
|
||||
errlog=errlog,
|
||||
)
|
||||
|
||||
# Must exceed session time plus the patched PROCESS_TERMINATION_TIMEOUT (10s).
|
||||
with anyio.fail_after(20):
|
||||
# Must exceed session time plus the patched PROCESS_TERMINATION_TIMEOUT (20s).
|
||||
with anyio.fail_after(30):
|
||||
async with Client(transport, logging_callback=collect) as client:
|
||||
assert client.initialize_result.server_info.name == "stdio-echo"
|
||||
result = await client.call_tool("echo", {"text": "across\nprocesses"})
|
||||
|
||||
Reference in New Issue
Block a user