Repository navigation
smoke: fail fast with actionable error when Electron crashes during launch - #322905
Merged
Alexandru Dima (alexdima) merged 3 commits intoJun 25, 2026
Merged
Alexandru Dima (alexdima) merged 3 commits into
Alexandru Dima (alexdima) merged 3 commits into
Conversation
…aunch The per-suite `before all` hook launches Electron via Playwright's `_electron.launch`. This was called with `timeout: 0`, so when the Electron process crashed during startup (e.g. a native SIGSEGV in the Chromium browser-process/sandbox init path, which leaves a minidump), the launch promise never resolved or rejected. It simply hung until Mocha's 120s `before all` hook timeout fired, producing an opaque "Timeout of 120000ms exceeded" with no hint that a native crash had occurred. Give the launch (and the first-window wait) a finite timeout well below the Mocha hook timeout and wrap them so a failure is re-thrown as an actionable error pointing at the crash-dump directory and Playwright trace. This turns a 120s opaque hang into a faster, clearly-diagnosable failure. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the Electron smoke-test harness by adding finite timeouts around Playwright Electron launch and first-window acquisition, and by rethrowing failures with a more actionable diagnostic message (crash-dump directory + Playwright trace guidance) instead of letting Mocha’s before all hook time out opaquely.
Changes:
- Introduce a 60s
LAUNCH_TIMEOUTfor_electron.launchand the initialwaitForEvent('window'). - Wrap launch and first-window waits in
try/catchand rethrow viaenrichLaunchError(...)for more actionable failures. - Add an
enrichLaunchErrorhelper that logs and provides crash/trace pointers.
Show a summary per file
| File | Description |
|---|---|
| test/automation/src/playwrightElectron.ts | Add bounded launch/window timeouts and enrich failures with actionable diagnostics to avoid opaque Mocha hook timeouts. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 2
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Alexandru Dima (alexdima)
enabled auto-merge (squash)
June 25, 2026 10:01
Alex Ross (alexr00)
approved these changes
Jun 25, 2026
Ladislau Szomoru (lszomoru)
approved these changes
Jun 25, 2026
Alexandru Dima (alexdima)
deleted the
agents/investigate-flaky-smoke-test-logs-f948ca42
branch
June 25, 2026 14:15
This was referenced Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The per-suite
before allhook in the Electron smoke tests launches Electron via Playwright's_electron.launch. It was called withtimeout: 0(no timeout), and the first-window wait usedtimeout: 0too.This PR gives both the launch and the first-window wait a finite timeout (
LAUNCH_TIMEOUT = 60s, well below Mocha's 120sbefore allhook timeout) and wraps them so a failure is re-thrown as an actionable error that points at the crash-dump directory and the Playwright trace.Why
Investigating a flaky smoke-test failure (run 28140700565,
Linux / Electron-Smoke):Root cause from the artifacts:
before allhook startedplaywright-electron#launchand then went completely silent for 120s (no Electron stdout at all), while the next suite launched normally in ~800ms.8_suite_Searchlaunch (pending/…dmp), timestamped ~1s after the launch was spawned: SIGSEGV (exception code0xb) in the Electron main/browser process, in the Chromium sandbox startup path (sandbox_ipc_linux.cc,network_sandbox.cc,namespace_sandbox.cc).Because
_electron.launchwas called withtimeout: 0, the crash never surfaced as a launch failure — the promise just hung until Mocha killed the hook at 120s, producing an opaque timeout with no hint that a native crash had occurred. This also explains why the same 120000ms timeout shows up across many different suites'before allhooks: the underlying native launch crash is suite-independent and rare, so it lands on whichever suite happens to be starting.Notes for reviewers
test/automationand was transpile-checked in isolation.Co-authored-by: Copilot [email protected]