mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
* test: remove 140 low-value cases and redundant browser probes * fix: remove unused upstream chat menu import * test: pin the host-split layout fixture branch --------- Co-authored-by: Orca Test Audit <test-audit@stably.ai> Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { afterEach, describe, expect, it, vi } from 'vitest'
|
|
import { OrcaRuntimeService } from './orca-runtime'
|
|
|
|
const PTY_ID = 'repo::/tmp/exit-record-wait@@pty'
|
|
const WORKTREE_ID = 'repo::/tmp/exit-record-wait'
|
|
|
|
afterEach(() => {
|
|
vi.useRealTimers()
|
|
})
|
|
|
|
describe('waitForPtyExitRecord', () => {
|
|
it('resolves true once the exit reaches the runtime record', async () => {
|
|
const runtime = new OrcaRuntimeService()
|
|
runtime.registerPty(PTY_ID, WORKTREE_ID, null)
|
|
const wait = runtime.waitForPtyExitRecord(PTY_ID, 10_000)
|
|
runtime.onPtyExit(PTY_ID, 0)
|
|
await expect(wait).resolves.toBe(true)
|
|
expect(runtime.getPtyLivenessVerdict(PTY_ID)).toEqual({ status: 'exited' })
|
|
})
|
|
|
|
it('resolves false when no exit arrives within the budget', async () => {
|
|
vi.useFakeTimers()
|
|
const runtime = new OrcaRuntimeService()
|
|
runtime.registerPty(PTY_ID, WORKTREE_ID, null)
|
|
const wait = runtime.waitForPtyExitRecord(PTY_ID, 1_000)
|
|
await vi.advanceTimersByTimeAsync(1_000)
|
|
await expect(wait).resolves.toBe(false)
|
|
runtime.onPtyExit(PTY_ID, 0)
|
|
})
|
|
})
|