Repository navigation
base red: UpdateInstallCheckTests fakes the frontmost app instead of reading a nil NSApp - #33093
Conversation
…s sibling suites do
theRelaunchRecordsTheInstallAndTheNextLaunchJudgesIt and
anInstallThatEndsWithTheAppRunningLeavesNoRecord call
updaterWillRelaunchApplication(), which reads UpdaterService.frontmost.
Its default is AppKit's answer (UpdateFrontmostApp.current()), which reads
NSApp.isActive. The package-test lane runs each suite in its own process,
and this suite makes no NSApplication, so NSApp is nil and the read traps
(UpdateRelaunchFocus.swift:99, 'Unexpectedly found nil'): the whole suite
crashes. It passed only when an earlier suite in the same process had made
NSApplication.shared.
The seam is there for tests ('AppKit in the app, a fake in tests');
UpdateRelaunchFocusTests and UpdateRelaunchHandoffTests set it. The helper
now sets it too. No product change: the app always has NSApp.
Culprit: 6229004 (#31178) added the suite without the fake.
Red: fleet job 2bf90b6c18ca136f3fb6c15d at feat 11dfe91.
|
Found 6 test failures on Blacksmith runners: Failures
|
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 6b31a88 to compare; do not merge until green; see lane-rules Shipped in:
|
|
Review (independent review subagent, Opus 5.5 claude-opus-5-5, read-only): SHIP at b356d59
|
|
Correction to my review receipt above: the lanes were red overall because of the test-bundle run-loop guard, which held the main thread in xctest. It was not the macOS AddressBook store; that was only a symptom. #33023 and #33013 fixed it on feat (ecfbb44). This head is older than that fix, so its lane still shows the XCTest stage red. The suite's own result (passes at this head, fails at the tip) is unchanged. No action is needed on this PR. |
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Summary
Base red on feat-cmux-next:
CmuxNextAppTests.UpdateInstallCheckTestscrashes intheRelaunchRecordsTheInstallAndTheNextLaunchJudgesIt(UpdateRelaunchFocus.swift:99, "Unexpectedly found nil while implicitly unwrapping an Optional value").Cause: the test calls
updaterWillRelaunchApplication(), which readsUpdaterService.frontmost. Its default is AppKit's answer (UpdateFrontmostApp.current()), which readsNSApp.isActive. The package-test lane runs each suite in its own process, and this suite makes noNSApplication, soNSAppis nil and the read traps. The suite passed only when an earlier suite in the same process had madeNSApplication.shared.Fix: the seam exists for tests ("AppKit in the app, a fake in tests");
UpdateRelaunchFocusTestsandUpdateRelaunchHandoffTestsset it. The suite's helper now sets it too (this app frontmost, as for a clicked Restart to Update). No product change: the app always hasNSApp.Culprit: 6229004 (#31178) added the suite without the fake.
Owner: no OWNERS.md row covers
CmuxNextUpdater.Testing
Command:
cmux-ci run --class light --display --script scripts/ci/package-test-lane.sh --ref SHA --arg=suite --arg=Packages/macOS/CmuxNext --arg=CmuxNextAppTests.UpdateInstallCheckTests(5 runs in one step).Each job's lane summary is red for a reason outside this change: on these hosts the target's XCTest pass aborts (signal 6, after Contacts/AddressBook CoreData store errors) or hangs ~680-900 s with no test in flight, after the Swift Testing pass. The Swift Testing results below are the suite's own.
Observed / Not run
Observed: the fleet runs above.
python3 scripts/cmux-next/prepush-gate.pypasses.Not run: no app build; test-only change.
Changelog
none