From 53ea3d2d813087b0d2e1ce4beac8dcd3dfc6b585 Mon Sep 17 00:00:00 2001 From: Jeff Dupont Date: Fri, 23 Oct 2026 12:14:42 -0700 Subject: [PATCH] test(opencode-agents): make the boot-timeout test robust on slow runners The test gave the stream a 0.2 s timeout after a 0.6 s fake boot. On a slow runner the stream alone can take longer than 0.2 s, so it failed without any bug. A 2.0 s boot against a 1.0 s timeout still fails if the boot moves inside the caller's timeout, and leaves the stream room. Co-Authored-By: Claude Opus 5.5 --- packages/opencode-agents/tests/test_handler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/opencode-agents/tests/test_handler.py b/packages/opencode-agents/tests/test_handler.py index cee6de67..4ac79057 100644 --- a/packages/opencode-agents/tests/test_handler.py +++ b/packages/opencode-agents/tests/test_handler.py @@ -1605,11 +1605,13 @@ async def test_boot_is_outside_the_caller_timeout(self) -> None: text_delta("m1", "p1", "Hi"), assistant_completed("m1"), ], - delay_ready=0.6, + delay_ready=2.0, ) handler = create_opencode_handler(**script.handler_args()) async with handler: - async with asyncio.timeout(0.2): + # The boot is twice the timeout, so the test fails if boot moves inside it. The + # 1 s timeout leaves the stream itself room on a slow runner. + async with asyncio.timeout(1.0): seen = [ event async for event in await handler.stream(