Repository navigation
fix(e2e): repair release e2e suite (parking regression tests, stale/flaky specs, profile switcher gate) - #8486
Conversation
…flaky specs, profile switcher gate Diagnosed 20 failing tests across the release e2e shards. Most are test debt, plus two genuine product-side issues. Product fixes: - OrcaProfileSwitcher: the PROD gate hid the "Switch profile" button in the e2e build (electron-vite build bakes NODE_ENV=production). Exempt MODE==='e2e' so the specs render it while packaged prod builds stay hidden. Parking cluster (8 tests): #8262 intentionally keeps the most-recently-hidden tab warm (exempt from cold-park). The specs hid exactly one tab — always the exempt one — so it never parked. Open a throwaway decoy tab that absorbs the last-active exemption so the target parks. (terminal-hidden-view-parking, terminal-pane-close-layout-consistency) Stale tests updated to match intended product behavior: - rich-markdown-link-bubble: match Edit link by aria-label (title dropped in #8307) - terminal-codex-hidden-startup-background: drop the dead hiddenRendererSkipCount poll (Phase-4 main-side delivery gate #7214 bypasses that renderer path) Brittle threshold/geometry/timing hardening (no product regression): - agent-session-log-tail-stability: assert full-model length instead of a machine-specific word-wrap pixel baseline - artificial-opencode revisit: dedicated under-backpressure latency bound - terminal-history-size-typing-latency: gate p90 not max (tolerate one checkpoint-in-window spike; median stays strict) - combined-diff-scroll-restore: assert viewport barely moved vs exact anchor key - terminal-shortcuts: idempotent kitty-flag reset instead of a racing stack pop - agent-session-live-force-exit-resume: drive the product quit-capture path - renderer-crash-recovery-terminal-input: poll the transport probe over the recovery budget (still flags a permanently frozen pane) terminal-push-delivery-loss-recovery left unchanged (no safe test-only improvement; recovery is wall-clock bounded with ample slack).
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughUpdates reliability-gate evidence and production profile-switcher behavior for e2e mode. E2E coverage now explicitly flushes sleeping agent sessions, validates log length and relaxed viewport containment, uses dedicated revisit and p90 latency thresholds, and polls transport recovery. Terminal lifecycle tests use decoy-backed parking orchestration, remove hidden-renderer debug assertions, improve accessible control selection, and set Kitty keyboard flags explicitly to zero. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/e2e/terminal-hidden-view-parking.spec.ts (1)
181-188: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract
parkHiddenTabBehindDecoyto a shared test helper.This helper is duplicated verbatim (modulo return type) in
tests/e2e/terminal-pane-close-layout-consistency.spec.ts:228-235. Extract it to a shared e2e utility module to avoid drift as more tests adopt the decoy pattern.The parking-spec variant returns
Promise<number>(elapsed ms fromwaitForTabParked); the pane-close variant returnsPromise<void>. A shared helper could always returnnumberand callers that don't need it simply ignore the value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 84fd3d35-cc5d-43a8-918c-8e3a651e730c
📒 Files selected for processing (14)
config/reliability-gates.jsoncsrc/renderer/src/components/orca-profiles/OrcaProfileSwitcher.tsxtests/e2e/agent-session-live-force-exit-resume.spec.tstests/e2e/agent-session-log-tail-stability.spec.tstests/e2e/artificial-opencode-revisit-pressure-scenario.tstests/e2e/artificial-opencode-terminal-load.spec.tstests/e2e/combined-diff-scroll-restore.spec.tstests/e2e/renderer-crash-recovery-terminal-input.spec.tstests/e2e/rich-markdown-link-bubble-stacking.spec.tstests/e2e/terminal-codex-hidden-startup-background.spec.tstests/e2e/terminal-hidden-view-parking.spec.tstests/e2e/terminal-history-size-typing-latency.spec.tstests/e2e/terminal-pane-close-layout-consistency.spec.tstests/e2e/terminal-shortcuts.spec.ts
- Deduplicate waitForTabParked/parkHiddenTabBehindDecoy, previously copy-pasted across the parking and layout-consistency specs - Parameterize parkDelayMs so the helper no longer depends on a file-local PARKING_DELAY_MS constant
…laky specs, profile switcher gate) (stablyai#8486) * fix(e2e): repair release e2e suite — parking regression tests, stale/flaky specs, profile switcher gate Diagnosed 20 failing tests across the release e2e shards. Most are test debt, plus two genuine product-side issues. Product fixes: - OrcaProfileSwitcher: the PROD gate hid the "Switch profile" button in the e2e build (electron-vite build bakes NODE_ENV=production). Exempt MODE==='e2e' so the specs render it while packaged prod builds stay hidden. Parking cluster (8 tests): stablyai#8262 intentionally keeps the most-recently-hidden tab warm (exempt from cold-park). The specs hid exactly one tab — always the exempt one — so it never parked. Open a throwaway decoy tab that absorbs the last-active exemption so the target parks. (terminal-hidden-view-parking, terminal-pane-close-layout-consistency) Stale tests updated to match intended product behavior: - rich-markdown-link-bubble: match Edit link by aria-label (title dropped in stablyai#8307) - terminal-codex-hidden-startup-background: drop the dead hiddenRendererSkipCount poll (Phase-4 main-side delivery gate stablyai#7214 bypasses that renderer path) Brittle threshold/geometry/timing hardening (no product regression): - agent-session-log-tail-stability: assert full-model length instead of a machine-specific word-wrap pixel baseline - artificial-opencode revisit: dedicated under-backpressure latency bound - terminal-history-size-typing-latency: gate p90 not max (tolerate one checkpoint-in-window spike; median stays strict) - combined-diff-scroll-restore: assert viewport barely moved vs exact anchor key - terminal-shortcuts: idempotent kitty-flag reset instead of a racing stack pop - agent-session-live-force-exit-resume: drive the product quit-capture path - renderer-crash-recovery-terminal-input: poll the transport probe over the recovery budget (still flags a permanently frozen pane) terminal-push-delivery-loss-recovery left unchanged (no safe test-only improvement; recovery is wall-clock bounded with ample slack). * Extract shared parking helpers into terminal-hidden-parking.ts for e2e s - Deduplicate waitForTabParked/parkHiddenTabBehindDecoy, previously copy-pasted across the parking and layout-consistency specs - Parameterize parkDelayMs so the helper no longer depends on a file-local PARKING_DELAY_MS constant
Summary
The release e2e suite had 20 failing tests across 8/10 shards (confirmed reproducible across the last several
Cut Releaseruns). Bisecting four consecutive release runs pinned each failure to its cause. Most are test debt; two are genuine product-side issues.Product fixes
OrcaProfileSwitcher— theif (import.meta.env.PROD) return nullgate hid the "Switch profile" button in the e2e build (electron-vitebuildbakesNODE_ENV=production, and the old comment wrongly claimed PROD is false under tests). ExemptMODE === 'e2e'so the specs render it while packaged prod builds stay hidden.Parking cluster (8 tests) — intended behavior, tests updated
Root-caused to #8262 ("cold-park keep-warm so common rotation never remounts"), which deliberately exempts the most-recently-hidden tab from cold-park. The specs hid exactly one tab — always the exempt one — so it never parked. Each test now opens a throwaway decoy tab that absorbs the last-active exemption, leaving the target free to park. (
terminal-hidden-view-parking,terminal-pane-close-layout-consistency)Stale tests (product changed, assertion didn't)
rich-markdown-link-bubble— match Edit link byaria-label(thetitlewas dropped when it became a shadcn Button in feat(markdown): support HTML superscript links #8307).terminal-codex-hidden-startup-background— drop the deadhiddenRendererSkipCountpoll; the Phase-4 main-side delivery gate (Terminal performance initiative: pipeline fixes + term-speed-2 revival + PTY flow control (integration branch) #7214) bypasses that renderer path by design. Retained assertions still prove hidden output is handled and restored on reveal.Brittle threshold / geometry / timing hardening (no product regression)
agent-session-log-tail-stability— assert full-model length (font-independent) instead of a machine-specific word-wrap pixel baseline.artificial-opencoderevisit — dedicated under-backpressure latency bound instead of reusing the unloaded 300 ms budget.terminal-history-size-typing-latency— gate p90 (not max) to tolerate the deliberate checkpoint-in-window spike; median stays strict.combined-diff-scroll-restore— assert the viewport barely moved instead of an exact anchor key at a section boundary.terminal-shortcuts— idempotent kitty-flag reset instead of a stack pop that raced the shell line editor.agent-session-live-force-exit-resume— drive the product's own quit-capture path so the record flushes deterministically.renderer-crash-recovery-terminal-input— poll the transport probe over the recovery budget (still flags a permanently frozen pane as the real bug).Left unchanged
terminal-push-delivery-loss-recovery— no source regression; recovery is dominated by fixed wall-clock timers with ~2.3× slack, so a speculative bump would only risk masking a future regression.Validation
oxlint,check:reliability-gates, andtypecheckall clean for the touched files. The Linux headless-Electron e2e suite itself must run in CI (can't run on macOS) — that's the purpose of this PR.Made with Orca 🐋