mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 08:03:39 +00:00
test(runtime): abort after the platform submit delay in the cancellation-during-verification test
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
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user