Skip to content

fix(e2e): run worktree first-paint probe on a mapped window - #20197

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/ci-switch-probe-linux
Sep 12, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/ci-switch-probe-linux

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​12
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5

ELI5

The first-paint test waited for animation frames from a window that Linux never displayed. Its clock never ticked, so it reported missing terminal content even when the terminal buffer was restored.

What Changed

  • Run the existing benchmark in the mapped-window (@headful) project on isolated Xvfb.
  • Preserve scheduled full-suite coverage with an explicit invocation on one shard and a workflow contract assertion.
  • Respect explicit background launches by not running a mapped-window benchmark in them.
  • Keep the frame probe, timeouts, restoration checks, one-pane activation assertion, and deferred warm-set checks unchanged. No production changes.

Why

The main-branch baseline fails with the same 30-second timeout as #20069: https://github.com/stablyai/orca/actions/runs/34668815923 . A Linux diagnostic run recorded zero animation frames and null activation/mount timestamps while the viewport buffer contained the expected WTB_T2 lines. Background-throttling switches and CDP focus emulation did not resume frames; mapping the test window did.

Linked Issue

Related: #20069 (CI investigation; does not close the mobile PR).

Visual Proof

N/A — test-environment correction only; no application UI or production behavior changes.

Testing

  • Linux/Xvfb reproduction: old hidden-window test fails with zero sampled frames.
  • Fixed test on the same PR build: three consecutive runs, five switches each; restoration medians 133.3, 126.3, and 138.4 ms. One pane mounted at activation in all 15 switches; all deferred tabs warmed.
  • Workflow contract suite: 42 tests passed.
  • Targeted lint and diff whitespace checks passed.
  • Windows/macOS mapped-window execution not repeated; no production platform/provider paths changed. CI validates the main-based fix separately.

Review

The test requires a real frame-producing surface; adding sleeps or replacing its frame clock with a timer would change the measurement. Changed-spec CI already selects the headful project for tagged tests. The explicit scheduled invocation prevents a silent loss of full-suite coverage.

Reliability

  • Invariant/oracle: revealed terminal content becomes renderable; activation mounts one pane and deferred panes join the warm set. Existing first-paint E2E assertions remain unchanged.
  • Failure source: repeated Linux CI failures on fix(mobile): stop a created tab from jumping when the host snapshot lands #20069 and its main baseline.
  • Gate: existing E2E workflow; no new production reliability surface.
  • Performance: no runtime polling, cache, subprocess, or ownership changes. One scheduled benchmark invocation replaces its former headless selection.
  • Diagnostics: Linux red/green measurements above and existing Playwright traces.
  • Coverage: local Linux PTY exercised; daemon/SSH/WSL/mobile wire behavior unaffected by this test-only change. Real-GPU and Windows/macOS frame timing remain unverified here.

Agent skill upstream boundary

  • Not applicable; no upstream skill source copied.

Checklist

  • Small, focused change with root-cause evidence.
  • Existing assertions and timeout budgets preserved.
  • No production code or mobile behavior changed.
  • Local targeted tests passed; full checks run in CI.

@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 68174341-804a-4d46-b269-b99763e5846a

📥 Commits

Reviewing files that changed from the base of the PR and between 556a777 and 0a8847f.

📒 Files selected for processing (3)
  • .github/workflows/e2e.yml
  • config/scripts/pr-e2e-gate-contract.test.mjs
  • tests/e2e/worktree-switch-first-paint.spec.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The E2E workflow runs the worktree first-paint benchmark once on shard 1/14 with headful Electron execution under xvfb-run and one worker. Contract tests verify these settings. The test is tagged @headful and skips when ORCA_BACKGROUND_LAUNCH is set to 1.

Priority: ⬇️ Low

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: running the worktree first-paint probe on a mapped window.
Description check ✅ Passed The description covers the required sections, explains the root cause and solution, identifies the related issue, provides visual-proof justification, documents testing, and records checklist status. …
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 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.

@pullfrog pullfrog 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.

ℹ️ No critical issues — one documentation note.

Reviewed changes

  • Mapped-window benchmark step — .github/workflows/e2e.yml adds a shard-1-only step that runs the first-paint spec under --project=electron-headful --workers=1 through xvfb-run and e2e-with-window-manager.sh.
  • Spec retagged @headful with a background skip — the probe now leaves the headless shards (grepInvert: /@headful/) and calls test.skip(process.env.ORCA_BACKGROUND_LAUNCH === '1', ...). Assertions, budget, and timeouts are unchanged.
  • Workflow contract — config/scripts/pr-e2e-gate-contract.test.mjs pins the new step's shard condition, Xvfb prefix, and headful/worker flags.

ℹ️ @headful now implies "needs a mapped window" for this spec, which the tag's documented contract doesn't mention

tests/AGENTS.md states that a @headful spec "still runs in the background," and the top-level AGENTS.md instructs agents and developers to launch automated runs with ORCA_BACKGROUND_LAUNCH=1. With this change the benchmark skips under that env and reports green, so the documented default silently drops the coverage and no doc names an invocation that actually exercises it locally.

Technical details
# Document the mapped-window requirement for the first-paint benchmark

## Affected sites
- `tests/AGENTS.md` — "Tag a spec `@headful` only when it needs real pixels; it still runs in the background." now conflicts with this spec.
- `tests/e2e/worktree-switch-first-paint.spec.ts:375-380` — skips when `ORCA_BACKGROUND_LAUNCH === '1'`; CI exercises it only through the new explicit headful step.

## Required outcome
- The tag policy or the spec records that frame-timing benchmarks need a mapped window and are skipped under explicit background launches, ideally naming the invocation that runs it (`--project=electron-headful` with `ORCA_BACKGROUND_LAUNCH` unset).

## Open questions for the human
- Is `@headful` the intended selector here, or should this benchmark carry a distinct opt-in tag so the "still runs in the background" contract stays accurate for it?

Pullfrog  | Fix it ➔ | View workflow run | Using openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@brennanb2025
brennanb2025 merged commit 76c8e91 into main Sep 12, 2026
35 checks passed
Fartown pushed a commit to Fartown/orca that referenced this pull request Sep 14, 2026
Upstream stablyai#20197 added its own "Run worktree first-paint benchmark" step and, in
the same change, a contract asserting exactly one step runs that spec. The fork
had added an equivalent step earlier for the same reason, so the sync left two
and both contracts went red.

Keep upstream's step and delete the fork's. What the fork actually contributed
here — retaining traces on the successful headful run, in both the sharded and
changed-spec jobs — stays.

Point the fork's own contract test at upstream's step, and at the full-run
command upstream moved from `--shard=` to a precomputed `--test-list`.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Ddyy32VYir3LAeFDHv71UT
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