From 3d939ae1b20aeea0ff58ce2355d34b026abd64ac Mon Sep 17 00:00:00 2001 From: Tauri-EPO Date: Wed, 19 Aug 2026 10:30:04 -0300 Subject: [PATCH] test(runtime): abort after the platform submit delay in the cancellation-during-verification test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test advanced fake timers by a hardcoded 500 — the non-Windows value of the submit-settle delay. On Windows the delay is 1_500 (ConPTY, #9925), so the abort landed during settlement, before the single Enter, and the toHaveLength(1) assertion failed on every Windows checkout while silently duplicating the sibling settlement test. Advancing by AGENT_PROMPT_SUBMIT_DELAY_MS aborts after the Enter on every platform, which is the scenario the test names. Fixes #15498 --- src/main/runtime/agent-prompt-submission-runtime.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/runtime/agent-prompt-submission-runtime.test.ts b/src/main/runtime/agent-prompt-submission-runtime.test.ts index ce19f22a3ca..8b996b80874 100644 --- a/src/main/runtime/agent-prompt-submission-runtime.test.ts +++ b/src/main/runtime/agent-prompt-submission-runtime.test.ts @@ -1,5 +1,8 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import { AGENT_PROMPT_BRACKETED_PASTE_END } from '../../shared/agent-prompt-injection' +import { + AGENT_PROMPT_BRACKETED_PASTE_END, + AGENT_PROMPT_SUBMIT_DELAY_MS +} from '../../shared/agent-prompt-injection' import { OrcaRuntimeService } from './orca-runtime' import { makeStore } from './runtime-rpc-worktree-store-fixtures' @@ -673,7 +676,8 @@ describe('agent prompt submission runtime', () => { }) const rejected = expect(submission).rejects.toThrow('request_aborted') - await vi.advanceTimersByTimeAsync(500) + // Why: the settle delay is platform-dependent (1_500 on Windows); a hardcoded 500 aborts before the Enter there. + await vi.advanceTimersByTimeAsync(AGENT_PROMPT_SUBMIT_DELAY_MS) controller.abort() await vi.runAllTimersAsync()