Repository navigation
test(browser): route input into fresh sandboxed popup iframes before clicking them - #30966
Conversation
…clicking them Fresh sandboxed iframes run in their own renderer and can finish loading before the browser routes pointer input to them, so Playwright's click landed on the parent and no popup opened. Hover-poll until the new frame sees trusted input before clicking, in one helper shared by the adapter, native and background popup probes. Share the cold first-frame budget from #30854 with popup-origin-chrome, which still waited only 10s for the same one-time GPU startup.
|
Local stress loop (Linux Docker container capped at 4 CPUs, |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
Some of our browser popup tests click a button inside a small embedded frame right after creating it. On a busy Linux CI machine the click sometimes arrives before the browser knows the new frame is there, so the click lands on the page around it and nothing happens. The test then waits 10 seconds for a popup that never opens, fails, and blocks unrelated PRs. Now the tests confirm the frame actually receives the mouse before they click.
What Changed
This changes the test harness only. App code is untouched.
Before:
browser-popup-adapter-compatibility.electron.test.ts("cannot distinguish inherited script restrictions…", "exposes inherited flags on native OpenURL link options only…") failed on fix(orcad-migration): a host fenced on a manifest no request can carry can be cancelled by its id #30864, fix(renderer): host writes route only through the strict owner, and twin projections stay on their host (review-5 #2 #9 #11) #30890 and brennanb2025/send-lifecycle-queue-derived-cards withexpected false to be true … Matcher did not succeed in time.Mechanism: each sandboxed
srcdociframe runs in its own renderer process. It can finish loading before the browser's hit testing routes pointer input to it. Playwright's actionability checks run inside the frame, so they pass, but the trusted click goes to the parent and the frame never sees it. I added instrumentation and reproduced this in CI: in all 4 failures the iframe recorded nopointerdownand noclick.After: a new
waitForHiddenFrameInput(locator)helper (src/main/browser/hidden-frame-input-readiness-fixture.ts) does three things before the click:pointermovelistener on the target;The background popup probe already had an inline copy of this check for its opaque frame. That copy now uses the shared helper. The helper also covers the adapter sandbox clicks and the native opaque-subframe Shift POST.
Cold first frame: test(browser): wait for the popup fixture's first paint during startup, not in the first test #30854 already moved the cold-start first-frame wait out of the first test, which was the reported native "Shift POST … : local" failure (runs 39324920346 and fix(ssh): two overlapping bridged-terminal attaches hand back the viewer they replace #30856's first run). This PR exports that 45s budget as a shared constant,
HIDDEN_RENDERER_FIRST_FRAME_TIMEOUT_MS. It also applies the constant topopup-origin-chrome.electron.test.ts, which runs in the same CI step and still gave the same one-time startup only 10s.Why
Linked Issue
N/A. This is a CI flake fix for an internal test harness; there is no issue.
Visual Proof
N/A. The change is test-only and has no UI or behaviour change.
Testing
CI reproduction before the fix: 8 GitHub
ubuntu-latestjobs, each repeating the two adapter sandbox tests 25 times in one Electron instance (temporary diagnostic workflow, now removed). 4 tests failed, and every failure showed the iframe got no pointer events.CI after the fix: the same 8 × 25-repetition jobs (about 2,400 sandboxed-frame clicks) gave 0 failures. 12 more cold-runner jobs ran all 5 popup Electron files (55 tests each) with 0 failures.
Local stress loop: Linux Docker container capped at 4 CPUs, with
stress-ng --cpu 8,ORCA_BACKGROUND_LAUNCH=1and hidden windows underxvfb. Each run is a fresh launch of the native and adapter files, with the sandbox tests repeated 5×. Results are in the PR comments.macOS: all 5 popup Electron files pass (55 tests), with
ORCA_BACKGROUND_LAUNCH=1.Static job: replayed locally (lint, format, anti-slop, code-quality plugins, type-aware lint, changed-code quality, typecheck, all ratchets, RPC catalog); everything passes.
Live verification: nothing was verified on a live machine beyond these test runs, since the change is test-only.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Codex (gpt-6.1-sol, high): no findings. Independent Opus review: nothing blocking. Its nits (an explicit poll timeout, the hook budget, comment wording) are applied.
Agent skill upstream boundary
Notes
Test-only. No SSH, mobile, wire-protocol or cross-platform runtime impact. The readiness hover uses Playwright input, so it behaves the same on every platform.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)