From ac2fe0fd6ec53e61346db90bcd678fbd8077aaae Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 16 Nov 2026 02:19:42 -0800 Subject: [PATCH] test: drain the command's completion before checking it in child-work admission The test polled for the compact turn's 'completed' state with vi.waitFor's 1 s default while the completion committed through the child's event sink; on a loaded runner (two CI runs) the commit outlasted the budget. It now flushes the sink and checks once. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../structured-conversation-command-child-work.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/native-chat/agent-session-wire/host/testing/structured-conversation-command-child-work.test.ts b/src/main/native-chat/agent-session-wire/host/testing/structured-conversation-command-child-work.test.ts index 4c6612628f1..565d7a1669a 100644 --- a/src/main/native-chat/agent-session-wire/host/testing/structured-conversation-command-child-work.test.ts +++ b/src/main/native-chat/agent-session-wire/host/testing/structured-conversation-command-child-work.test.ts @@ -119,9 +119,9 @@ describe('conversation command admission reads the work the provider reported', expect(await state.host.conversationCommand(CALLER, first)).toMatchObject({ ok: true }) await vi.waitFor(() => expect(compact).toHaveBeenCalledTimes(1)) finish() - await vi.waitFor(async () => - expect(await commandTurnState(first.envelope.clientOperationId)).toBe('completed') - ) + // The completion commits through the child's event sink; drain it instead of polling 1 s. + await state.host.flushStreamedEvents(HOST_TEST_SESSION) + expect(await commandTurnState(first.envelope.clientOperationId)).toBe('completed') report([devServer()]) await vi.waitFor(() =>