Skip to content

Prevent Mac test-host crash after exit-guard window test - #46

Merged
mikecerisano merged 1 commit into
mainfrom
investigate/mac-test-host-crash-20261017
Oct 17, 2026
Merged

mikecerisano merged 1 commit into
mainfrom
investigate/mac-test-host-crash-20261017

Conversation

@mikecerisano

@mikecerisano mikecerisano commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

The Mac app test host intermittently crashed after the exit-guard window test. The test creates an NSWindow, closes it for real, and keeps using a Swift local reference. AppKit defaults isReleasedWhenClosed to true, so the test's final close lets AppKit release a window that the local still owns. This change makes that test-owned window opt out of AppKit's automatic release. Production window behavior is unchanged.

Local validation on clean main before the change: the exit-guard and finish-notice suites reproduced a test-host EXC_BAD_ACCESS in objc_release, followed by Xcode's automatic test-host restart. The finish-notice suite alone passed. After the change, the exact two-suite reproducer passed 13/13 without a restart, then passed three additional repeat runs. The full serialized Mac app suite passed uninterrupted: 1,156 passed, 13 skipped, 0 failed. git diff --check passed. The other Mac tests that create and close their own NSWindow already set isReleasedWhenClosed=false.

The branch was rebased onto current main after those tests. The only intervening main commit (#43) added opt-in crash evidence, did not touch this test, and independently passed the full serialized Mac suite (1,156 passed, 13 skipped, 0 failed). These local runs are the validation gate; GitHub CI credits are exhausted.

@mikecerisano
mikecerisano marked this pull request as ready for review October 17, 2026 14:54
@mikecerisano
mikecerisano merged commit e875735 into main Oct 17, 2026
4 of 8 checks passed
@mikecerisano
mikecerisano deleted the investigate/mac-test-host-crash-20261017 branch October 17, 2026 14:55
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