Skip to content

fix(e2e): repair release e2e suite (parking regression tests, stale/flaky specs, profile switcher gate) - #8486

Merged
AmethystLiang merged 2 commits into
mainfrom
fix-e2e-tests
Jul 13, 2026
Merged

AmethystLiang merged 2 commits into
mainfrom
fix-e2e-tests

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The release e2e suite had 20 failing tests across 8/10 shards (confirmed reproducible across the last several Cut Release runs). Bisecting four consecutive release runs pinned each failure to its cause. Most are test debt; two are genuine product-side issues.

Product fixes

  • OrcaProfileSwitcher — the if (import.meta.env.PROD) return null gate hid the "Switch profile" button in the e2e build (electron-vite build bakes NODE_ENV=production, and the old comment wrongly claimed PROD is false under tests). Exempt MODE === '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)

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-opencode revisit — 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, and typecheck all 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 🐋

…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).
@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 94f854b7-7b9a-4185-bbaf-4dd26a88b846

📥 Commits

Reviewing files that changed from the base of the PR and between 1680c76 and 3a933f7.

📒 Files selected for processing (3)
  • tests/e2e/helpers/terminal-hidden-parking.ts
  • tests/e2e/terminal-hidden-view-parking.spec.ts
  • tests/e2e/terminal-pane-close-layout-consistency.spec.ts

📝 Walkthrough

Walkthrough

Updates 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)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes Summary and Validation, but it omits several required template sections such as Screenshots, Testing, AI Review Report, Security Audit, and Notes. Add the missing template sections, including screenshots or no visual change, the testing checklist, AI review report, security audit, and notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main E2E repair work and profile switcher gate change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/e2e/terminal-hidden-view-parking.spec.ts (1)

181-188: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract parkHiddenTabBehindDecoy to 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 from waitForTabParked); the pane-close variant returns Promise<void>. A shared helper could always return number and 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

📥 Commits

Reviewing files that changed from the base of the PR and between 371d71a and 1680c76.

📒 Files selected for processing (14)
  • config/reliability-gates.jsonc
  • src/renderer/src/components/orca-profiles/OrcaProfileSwitcher.tsx
  • tests/e2e/agent-session-live-force-exit-resume.spec.ts
  • tests/e2e/agent-session-log-tail-stability.spec.ts
  • tests/e2e/artificial-opencode-revisit-pressure-scenario.ts
  • tests/e2e/artificial-opencode-terminal-load.spec.ts
  • tests/e2e/combined-diff-scroll-restore.spec.ts
  • tests/e2e/renderer-crash-recovery-terminal-input.spec.ts
  • tests/e2e/rich-markdown-link-bubble-stacking.spec.ts
  • tests/e2e/terminal-codex-hidden-startup-background.spec.ts
  • tests/e2e/terminal-hidden-view-parking.spec.ts
  • tests/e2e/terminal-history-size-typing-latency.spec.ts
  • tests/e2e/terminal-pane-close-layout-consistency.spec.ts
  • tests/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
@AmethystLiang
AmethystLiang merged commit 220811c into main Jul 13, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant