From 1d2b8c7f4258338c59ff07b9a076b44fa5d1c19a Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Thu, 13 Aug 2026 08:58:04 -0700 Subject: [PATCH] test(e2e): stabilize triaged release failures (#14242) * test(e2e): stabilize triaged release failures * rm file --- .../artificial-opencode-terminal-load.spec.ts | 6 ++--- tests/e2e/settings-agent-awake.spec.ts | 8 +++---- tests/e2e/ssh-config-host-picker.spec.ts | 2 +- tests/e2e/status-bar-caffeinate.spec.ts | 22 +++++++++---------- .../e2e/terminal-hidden-view-parking.spec.ts | 5 +++++ tests/e2e/voice-microphone-selection.spec.ts | 7 +++--- 6 files changed, 28 insertions(+), 22 deletions(-) diff --git a/tests/e2e/artificial-opencode-terminal-load.spec.ts b/tests/e2e/artificial-opencode-terminal-load.spec.ts index 0a3e1570769..c9d3817bb31 100644 --- a/tests/e2e/artificial-opencode-terminal-load.spec.ts +++ b/tests/e2e/artificial-opencode-terminal-load.spec.ts @@ -125,9 +125,9 @@ const MAX_WORST_KEY_LATENCY_MS = 300 // whichever synthetic flush it collides with, so on a CPU-starved OSS shard it // is environment-dominated (seen at ~3.1s) even when typing stays instant. The // median (75ms) is the real responsiveness guard; keep worst-under-load only as -// a catastrophic-hang detector. Mirrors ssh-docker-relay-perf's 2s worst-key -// tolerance and the hidden-pressure scenario's relaxed worst budget. -const MAX_WORST_KEY_LATENCY_UNDER_LOAD_MS = 3_000 +// a catastrophic-hang detector. Leave CI headroom above the observed ~3.1s +// scheduler overrun while still surfacing multi-second renderer stalls. +const MAX_WORST_KEY_LATENCY_UNDER_LOAD_MS = 3_500 // Why: the post-revisit printf is sampled while the background panes are still // ACK-gate-held and through a whole-buffer serialize poll, so it inherits the // same environment-dominated worst-case as typing under load; the unloaded diff --git a/tests/e2e/settings-agent-awake.spec.ts b/tests/e2e/settings-agent-awake.spec.ts index 0432970b39c..15c25e2fc4e 100644 --- a/tests/e2e/settings-agent-awake.spec.ts +++ b/tests/e2e/settings-agent-awake.spec.ts @@ -150,15 +150,15 @@ test.describe('Agent awake setting', () => { name: 'Keep computer awake' }) const offMode = keepAwakeModes.getByRole('radio', { name: 'Off' }) - const autoMode = keepAwakeModes.getByRole('radio', { name: 'Auto' }) + const agentMode = keepAwakeModes.getByRole('radio', { name: 'Agent' }) await expect(offMode).toHaveAttribute('aria-checked', 'true') - await autoMode.click() - await expect(autoMode).toHaveAttribute('aria-checked', 'true') + await agentMode.click() + await expect(agentMode).toHaveAttribute('aria-checked', 'true') await expect .poll(async () => (await getSettings(orcaPage)).computerAwakeMode, { timeout: 5_000, - message: 'keep-awake mode did not persist after selecting Auto' + message: 'keep-awake mode did not persist after selecting Agent' }) .toBe('auto') diff --git a/tests/e2e/ssh-config-host-picker.spec.ts b/tests/e2e/ssh-config-host-picker.spec.ts index fe717762d7b..467533c58a5 100644 --- a/tests/e2e/ssh-config-host-picker.spec.ts +++ b/tests/e2e/ssh-config-host-picker.spec.ts @@ -138,8 +138,8 @@ test.describe('SSH config host picker', () => { await form.getByRole('button', { name: 'Save' }).click() await expect(form).toBeHidden({ timeout: 10_000 }) - await expect(orcaPage.getByText('SSH host added.')).toBeVisible({ timeout: 5_000 }) + // The saved settings card is durable; the success toast is not. const sshSection = await openSshHostSettings(orcaPage) await expectSshHostListedInSettings(sshSection, prod) }) diff --git a/tests/e2e/status-bar-caffeinate.spec.ts b/tests/e2e/status-bar-caffeinate.spec.ts index 2e28770213d..712f77e9294 100644 --- a/tests/e2e/status-bar-caffeinate.spec.ts +++ b/tests/e2e/status-bar-caffeinate.spec.ts @@ -28,7 +28,7 @@ async function postCodexHookEvent( expect(response.status).toBe(204) } -test('shows Caffeinate mode and Auto activity in the status bar', async ({ +test('shows Caffeinate mode and Agent activity in the status bar', async ({ electronApp, orcaPage }) => { @@ -39,26 +39,26 @@ test('shows Caffeinate mode and Auto activity in the status bar', async ({ await expect(offStatus).toHaveText('Off') await offStatus.click() await expect(orcaPage.getByRole('menuitemradio', { name: /^On/ })).toBeVisible() - await expect(orcaPage.getByRole('menuitemradio', { name: /^Auto/ })).toBeVisible() + await expect(orcaPage.getByRole('menuitemradio', { name: /^Agent/ })).toBeVisible() await expect(orcaPage.getByRole('menuitemradio', { name: /^Off/ })).toBeVisible() const menuProofPath = process.env.ORCA_CAFFEINATE_MENU_PROOF_PATH if (menuProofPath) { await orcaPage.screenshot({ path: menuProofPath }) } - await orcaPage.getByRole('menuitemradio', { name: /^Auto/ }).click() + await orcaPage.getByRole('menuitemradio', { name: /^Agent/ }).click() - const autoInactiveStatus = orcaPage.getByRole('button', { - name: 'Caffeinate, Auto · Inactive' + const agentInactiveStatus = orcaPage.getByRole('button', { + name: 'Caffeinate, Agent · Inactive' }) - await expect(autoInactiveStatus).toBeVisible() + await expect(agentInactiveStatus).toBeVisible() const paneKey = `e2e-caffeinate-tab:${randomUUID()}` await postCodexHookEvent(electronApp, paneKey, 'UserPromptSubmit') - const autoActiveStatus = orcaPage.getByRole('button', { - name: 'Caffeinate, Auto · Active' + const agentActiveStatus = orcaPage.getByRole('button', { + name: 'Caffeinate, Agent · Active' }) - await expect(autoActiveStatus).toBeVisible() - await expect(autoActiveStatus).toHaveText('Auto') + await expect(agentActiveStatus).toBeVisible() + await expect(agentActiveStatus).toHaveText('Agent') const proofPath = process.env.ORCA_CAFFEINATE_PROOF_PATH if (proofPath) { @@ -66,5 +66,5 @@ test('shows Caffeinate mode and Auto activity in the status bar', async ({ } await postCodexHookEvent(electronApp, paneKey, 'Stop') - await expect(autoInactiveStatus).toBeVisible() + await expect(agentInactiveStatus).toBeVisible() }) diff --git a/tests/e2e/terminal-hidden-view-parking.spec.ts b/tests/e2e/terminal-hidden-view-parking.spec.ts index 9f31d69321c..19fc02e8486 100644 --- a/tests/e2e/terminal-hidden-view-parking.spec.ts +++ b/tests/e2e/terminal-hidden-view-parking.spec.ts @@ -18,6 +18,7 @@ import { waitForPaneIdentitySnapshot } from './helpers/terminal' import { parkHiddenTabBehindDecoy, waitForTabParked } from './helpers/terminal-hidden-parking' +import { TERMINAL_TAB_PARK_FLIP_BURST_WINDOW_MS } from '../../src/renderer/src/components/terminal-pane/terminal-park-verdict-flip-telemetry' // Why: the parking wiring registers this handle (dev/exposeStore builds only) // so tests can detect that hidden-view parking is compiled in and which delay @@ -40,6 +41,7 @@ test.use({ const PARKED_FRAME_SCRIPT_DELAY_MS = 750 const PARKED_FRAME_COUNT = 25 +const PARK_VERDICT_BURST_SETTLE_MS = TERMINAL_TAB_PARK_FLIP_BURST_WINDOW_MS * 4 function parkedTuiFrame(runId: string, frame: number): string { const progress = `${'█'.repeat((frame % 8) + 1)}${'░'.repeat(8 - ((frame % 8) + 1))}` @@ -531,6 +533,9 @@ test.describe('Terminal hidden view parking', () => { const CYCLES = 25 const mismatches: string[] = [] for (let cycle = 1; cycle < CYCLES; cycle++) { + // Why: each cycle intentionally flips this tab's rendered verdict twice. + // Let the production anti-churn burst window lapse before the next one. + await orcaPage.waitForTimeout(PARK_VERDICT_BURST_SETTLE_MS) const rows = await runOneParkRevealCycle(cycle) if (JSON.stringify(rows) !== JSON.stringify(referenceRows)) { mismatches.push( diff --git a/tests/e2e/voice-microphone-selection.spec.ts b/tests/e2e/voice-microphone-selection.spec.ts index 54f3edeb37a..748df0a72a2 100644 --- a/tests/e2e/voice-microphone-selection.spec.ts +++ b/tests/e2e/voice-microphone-selection.spec.ts @@ -116,7 +116,8 @@ test.describe('Voice microphone selection', () => { const microphone = orcaPage.getByRole('combobox', { name: 'Microphone' }) await expect(microphone).toHaveText('System default') - await microphone.click() + // Settings can still be animating; keyboard activation does not depend on its position. + await microphone.press('Space') await expect(orcaPage.getByRole('option', { name: 'USB Microphone' })).toBeVisible() await orcaPage.getByRole('option', { name: 'USB Microphone' }).click() @@ -147,7 +148,7 @@ test.describe('Voice microphone selection', () => { await prepareVoiceSettings(orcaPage, 'stale-airpods-id', 'AirPods') const microphone = orcaPage.getByRole('combobox', { name: 'Microphone' }) - await microphone.click() + await microphone.press('Space') await expect(orcaPage.getByRole('option', { name: 'AirPods (unavailable)' })).toBeVisible() await orcaPage.keyboard.press('Escape') @@ -165,7 +166,7 @@ test.describe('Voice microphone selection', () => { }) await expect(microphone).toHaveText('AirPods') - await microphone.click() + await microphone.press('Space') await expect(orcaPage.getByRole('option', { name: 'AirPods' })).toBeVisible() await expect(orcaPage.getByRole('option', { name: 'AirPods (unavailable)' })).toHaveCount(0) await orcaPage.keyboard.press('Escape')