You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
testCmdWClosesWindowWhenClosingLastSurfaceInLastWorkspace presses Cmd+W on the last surface in the last workspace and expects the window to close. On CI the window never closes.
programaTests/AppDelegateShortcutRoutingTests.swift:1463: failed - Timed out waiting for
Cmd+W on the last surface to close the window
programaTests/AppDelegateShortcutRoutingTests.swift:1465: XCTAssertNil failed: "<NSWindow: 0x9d684d180>"
This test has been skipped in scripts/ci-run-unit-tests.sh for months with no recorded reason. #221 un-skipped it to find out why, got the above, and restored the skip with the reason documented.
The shortcut dispatches correctly. The XCTAssertTrue(appDelegate.debugHandleCustomShortcut(event:)) immediately above the failing assertion passes. Routing works; the close it should trigger does not complete.
Headless window closing works in general.testCmdCtrlWPromptsBeforeClosingWindow and testCmdCtrlWClosesWindowAfterConfirmation both close real NSWindows on the same runner and are not skipped.
So this is specific to the cascade the test exercises: close last surface → close last workspace → close window. Cmd+Ctrl+W, which closes the window directly, is fine.
Steps to reproduce
Remove the -skip-testing:${STATEFUL_TEST_SKIP} lines from scripts/ci-run-unit-tests.sh (both the stateful and serial arms)
Push and let the unit-tests job run
The stateful pass fails with the two errors above
Reproduced twice in the same run — the retry hit it identically.
What is not known
Whether this is a headless-only limitation of the test host or a real bug in a path users rely on. Nobody has reproduced it outside CI, and the behaviour is presumably fine in the shipping app, since closing the last surface with Cmd+W is an ordinary thing to do.
Both possibilities are worth resolving, and they need opposite fixes:
Headless limitation → document it in the test, and consider whether the assertion can be rewritten against something observable in that environment.
Real bug → the cascade drops the window close somewhere, and that is worth finding regardless of the test.
Verify
With the skip removed, testCmdWClosesWindowWhenClosingLastSurfaceInLastWorkspace passes in the stateful pass of scripts/ci-run-unit-tests.sh, and the skip can be deleted for good.
Context
Found while working #186. The skip's full reasoning is now written into scripts/ci-run-unit-tests.sh above STATEFUL_TEST_SKIP — it explicitly warns against reading it as flakiness.
What happens
testCmdWClosesWindowWhenClosingLastSurfaceInLastWorkspacepresses Cmd+W on the last surface in the last workspace and expects the window to close. On CI the window never closes.This test has been skipped in
scripts/ci-run-unit-tests.shfor months with no recorded reason. #221 un-skipped it to find out why, got the above, and restored the skip with the reason documented.Why this is not just a flaky test
Three things establish that:
XCTAssertTrue(appDelegate.debugHandleCustomShortcut(event:))immediately above the failing assertion passes. Routing works; the close it should trigger does not complete.testCmdCtrlWPromptsBeforeClosingWindowandtestCmdCtrlWClosesWindowAfterConfirmationboth close realNSWindows on the same runner and are not skipped.So this is specific to the cascade the test exercises: close last surface → close last workspace → close window. Cmd+Ctrl+W, which closes the window directly, is fine.
Steps to reproduce
-skip-testing:${STATEFUL_TEST_SKIP}lines fromscripts/ci-run-unit-tests.sh(both thestatefulandserialarms)unit-testsjob runReproduced twice in the same run — the retry hit it identically.
What is not known
Whether this is a headless-only limitation of the test host or a real bug in a path users rely on. Nobody has reproduced it outside CI, and the behaviour is presumably fine in the shipping app, since closing the last surface with Cmd+W is an ordinary thing to do.
Both possibilities are worth resolving, and they need opposite fixes:
Verify
With the skip removed,
testCmdWClosesWindowWhenClosingLastSurfaceInLastWorkspacepasses in thestatefulpass ofscripts/ci-run-unit-tests.sh, and the skip can be deleted for good.Context
Found while working #186. The skip's full reasoning is now written into
scripts/ci-run-unit-tests.shaboveSTATEFUL_TEST_SKIP— it explicitly warns against reading it as flakiness.