From 433cd1bc60034dfb65265eaa9abff43990eeea08 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Fri, 16 Oct 2026 21:02:03 -0700 Subject: [PATCH] test(tui): give the mounted switcher-close tests a budget that covers their waits (TUI-25) The two mounted-switcher tests chain three `vi.waitFor` frame waits, each allowed 10 s, but the test itself kept vitest's 5 s default. On the loaded CI runner the first Ink frame took long enough that the test timed out at 5 s while its waits still had budget ("Test timed out in 5000ms" on #140183's JS & TS checks). Each mounted test now declares 3 x WAIT; the assertions are unchanged. Refs #134889 (TUI-25) Refs #140138 --- ui-tui/src/__tests__/canonicalSwitcherClose.test.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui-tui/src/__tests__/canonicalSwitcherClose.test.tsx b/ui-tui/src/__tests__/canonicalSwitcherClose.test.tsx index ffa77d96cd..1674e81f70 100644 --- a/ui-tui/src/__tests__/canonicalSwitcherClose.test.tsx +++ b/ui-tui/src/__tests__/canonicalSwitcherClose.test.tsx @@ -19,6 +19,9 @@ import { DEFAULT_THEME } from '../theme.js' // vi.waitFor's 1 s default is shorter than a first Ink frame on a loaded CI host. const WAIT = { timeout: 10_000 } +// A mounted switcher chains three WAIT-bounded frame waits; the test's own budget must cover them, +// or vitest's 5 s default fires first on a loaded runner (the waits never get their 10 s). +const MOUNTED_TEST_TIMEOUT = 3 * WAIT.timeout const liveRow = { id: 'live', session_id: 'live', title: 'Current conversation', started_at: 2, message_count: 1, running: false } @@ -185,7 +188,7 @@ it('reports no close instead of blaming main when the canonical row is not held' } finally { m.instance.unmount() } -}) +}, MOUNTED_TEST_TIMEOUT) it('keeps main\'s "already closed" for a receipt that refuses the close', async () => { const onClose = vi.fn(async () => ({ closed: false })) @@ -197,4 +200,4 @@ it('keeps main\'s "already closed" for a receipt that refuses the close', async } finally { m.instance.unmount() } -}) +}, MOUNTED_TEST_TIMEOUT)