Repository navigation
ci: suppress macOS 'reopen windows' prompt for Electron test bundle - #51488
Merged
Merged
Conversation
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
deepak1556
approved these changes
May 5, 2026
deepak1556
left a comment
Member
There was a problem hiding this comment.
Awesome, thank you @MarshallOfSound
nmggithub
approved these changes
May 5, 2026
nmggithub
left a comment
Contributor
There was a problem hiding this comment.
Can confirm myself that this (probably) works!
jkleinsc
approved these changes
May 5, 2026
|
No Release Notes |
Contributor
|
I have automatically backported this PR to "41-x-y", please check out #51494 |
Contributor
|
I have automatically backported this PR to "40-x-y", please check out #51495 |
Contributor
|
I have automatically backported this PR to "42-x-y", please check out #51496 |
5 tasks done
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of Change
Tests spawn child
Electron.appinstances and kill them withSIGINT(e.g.startRemoteControlApp). After enough abnormal exits of the same bundle ID, AppKit shows a modal alert inside the open-application AppleEvent handler:That handler runs before
applicationDidFinishLaunching:is posted, so the alert blocksapp.whenReady()forever and the next spawned fixture that waits for ready hangs until the 60-minute job timeout.Why this started at #51279, why
mainis green right now, and why this PR is still neededscript/split-tests.jssorts spec files by theirit(-substring count and round-robins into shards, so any test-count change can reshuffle which files share a shard.8f0f08e818(#51279)api-utility-process-spec.ts→ it moved onto shard 2 ahead ofesm-spec.tsesm-specimport-meta fixture — first failure0f77f20d4f(#51432)esm-spec.tsrunFixture→ itsit(-count tied withguest-window-manager-spec.ts→esm-specmoved off shard 2node-spec.ts"does not hang when using the fs module in the renderer process" — itslibuv-hangfixture is the next child that doesapp.whenReady().then(...)afterapi-utility-process-specf9635f7b3a(#51476)talagentd's abnormal-exit flag (and itsSIGKILLs add to it). Either lucky timing or the 5 kills it logged were late enough not to matterSo
maingoing 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)
AEProcessAppleEvent→-[NSAppleEventManager dispatchRawAppleEvent:…]→ nested_BlockUntilNextEventMatchingListInModeWithFilter-ApplePersistenceIgnoreState YES=PASS,rm -rf …/com.github.Electron.savedState=HANG (the crash flag is held bytalagentd, not on disk)PromiseBase::Resolveis never called, no GC runs in the relevant windowSetting
ApplePersistenceIgnoreStateonce forcom.github.Electrondisables the persistent-UI machinery (including this prompt) for every Electron launch in the test job, mirroring the existingCrashReporter DialogTypesuppression directly above it.Fixes #51462.
Checklist
Release Notes
Notes: none