Skip to content

ci: suppress macOS 'reopen windows' prompt for Electron test bundle - #51488

Merged
jkleinsc merged 1 commit into
mainfrom
sattard/fix-51462-persistence-state
May 5, 2026
Merged

jkleinsc merged 1 commit into
mainfrom
sattard/fix-51462-persistence-state

Conversation

@MarshallOfSound

@MarshallOfSound MarshallOfSound commented May 5, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Tests spawn child Electron.app instances and kill them with SIGINT (e.g. startRemoteControlApp). After enough abnormal exits of the same bundle ID, AppKit shows a modal alert inside the open-application AppleEvent handler:

The last time you opened Electron, it unexpectedly quit while reopening windows. Do you want to try to reopen its windows again?

That handler runs before applicationDidFinishLaunching: is posted, so the alert blocks app.whenReady() forever and the next spawned fixture that waits for ready hangs until the 60-minute job timeout.

Why this started at #51279, why main is green right now, and why this PR is still needed

script/split-tests.js sorts spec files by their it(-substring count and round-robins into shards, so any test-count change can reshuffle which files share a shard.

commit what changed macOS-x64 shard-2 victim
8f0f08e818 (#51279) +17 tests in api-utility-process-spec.ts → it moved onto shard 2 ahead of esm-spec.ts esm-spec import-meta fixture — first failure
0f77f20d4f (#51432) refactored esm-spec.ts runFixture → its it(-count tied with guest-window-manager-spec.ts → esm-spec moved off shard 2 bug moved to node-spec.ts "does not hang when using the fs module in the renderer process" — its libuv-hang fixture is the next child that does app.whenReady().then(...) after api-utility-process-spec
f9635f7b3a (#51476) orphan-process killer green run, but not a fix — the orphan killer can't clear talagentd's abnormal-exit flag (and its SIGKILLs add to it). Either lucky timing or the 5 kills it logged were late enough not to matter

So main going green was a shard reshuffle, not a fix. The next test-count change that reshuffles will surface it again on whichever child-Electron-that-awaits-whenReady() lands after a SIGINT-heavy spec. This PR fixes it for all of them regardless of shard order.

Evidence (debug branch #51483)

Setting ApplePersistenceIgnoreState once for com.github.Electron disables the persistent-UI machinery (including this prompt) for every Electron launch in the test job, mirroring the existing CrashReporter DialogType suppression directly above it.

Fixes #51462.

Checklist

Release Notes

Notes: none

Tests spawn child Electron.app instances and kill them with SIGINT (e.g.
startRemoteControlApp). After enough abnormal exits of the same bundle ID,
AppKit shows a modal "...unexpectedly quit while reopening windows. Do you
want to try to reopen its windows again?" alert inside the
open-application AppleEvent handler. That handler runs before
applicationDidFinishLaunching: is posted, so the alert blocks
app.whenReady() forever and the spawned fixture hangs until the job times
out.

Setting ApplePersistenceIgnoreState for com.github.Electron disables the
persistent-UI machinery (including this prompt) for every Electron launch
in the test job, mirroring the existing CrashReporter DialogType
suppression directly above.

Fixes #51462
@MarshallOfSound
MarshallOfSound requested a review from a team May 5, 2026 04:54
@MarshallOfSound MarshallOfSound added semver/none target/40-x-y PR should also be added to the "40-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. labels May 5, 2026

@deepak1556 deepak1556 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome, thank you @MarshallOfSound

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

Can confirm myself that this (probably) works!

@jkleinsc
jkleinsc merged commit c16c6da into main May 5, 2026
186 of 191 checks passed
@jkleinsc
jkleinsc deleted the sattard/fix-51462-persistence-state branch May 5, 2026 09:45
@release-clerk

release-clerk Bot commented May 5, 2026

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "41-x-y", please check out #51494

@trop trop Bot added in-flight/41-x-y and removed target/41-x-y PR should also be added to the "41-x-y" branch. labels May 5, 2026
@trop

trop Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "40-x-y", please check out #51495

@trop

trop Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "42-x-y", please check out #51496

@trop trop Bot added in-flight/40-x-y in-flight/42-x-y merged/41-x-y PR was merged to the "41-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. merged/42-x-y PR was merged to the "42-x-y" branch. and removed target/40-x-y PR should also be added to the "40-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. in-flight/41-x-y in-flight/40-x-y in-flight/42-x-y labels May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. merged/42-x-y PR was merged to the "42-x-y" branch. semver/none

Projects

None yet

4 participants