Skip to content

test: record why testCmdWClosesWindowWhenClosingLastSurfaceInLastWorkspace is skipped - #221

Merged
arzafran merged 2 commits into
mainfrom
test/186-unskip-cmdw-close
Jul 30, 2026
Merged

test: record why testCmdWClosesWindowWhenClosingLastSurfaceInLastWorkspace is skipped#221
arzafran merged 2 commits into
mainfrom
test/186-unskip-cmdw-close

Conversation

@arzafran

@arzafran arzafran commented Jul 30, 2026

Copy link
Copy Markdown
Member

Refs #186. The experiment ran and gave an answer. Final diff is comment-only.

What this started as

scripts/ci-run-unit-tests.sh:19 excluded a test from CI with no comment, and the commit that added it (cf542e67da) says nothing about it — while QUARANTINED_ON_COMPAT three lines below justifies itself in several paragraphs. One test silently excluded, no rationale on record, no way to tell whether it wanted fixing or deleting.

#218 had just replaced its single fixed 0.05s spin with a 2s condition wait, so timing was the obvious suspect. This PR un-skipped it to find out.

What CI answered

AppDelegateShortcutRoutingTests.swift:1463: failed - Timed out waiting for
  Cmd+W on the last surface to close the window
AppDelegateShortcutRoutingTests.swift:1465: XCTAssertNil failed: "<NSWindow: 0x...>"

It does not flake. It fails. Three things narrow it down:

  1. Not a timing race. It waits the full two seconds and the window is still there. More time does not help.
  2. The shortcut dispatches fine — the XCTAssertTrue(debugHandleCustomShortcut(...)) immediately above it passes. Routing works; the resulting close doesn't complete.
  3. Headless window closing works in general. testCmdCtrlWPromptsBeforeClosingWindow and ...ClosesWindowAfterConfirmation both close real windows on the same runner and aren't skipped.

So it's specific to the cascade this test exercises: close last surface → close last workspace → close window. Whether that's a headless-only gap or a real bug in a path users rely on is undetermined — nobody has reproduced it outside CI.

What this PR now does

Restores the skip, with all of that written down. The wiring is byte-identical to main; the diff is comment-only. CI stays green.

The important change is that this stops being an unexplained exclusion. The comment says explicitly not to read it as flakiness — it's a known, reproducible failure of user-facing behaviour, parked rather than diagnosed.

Follow-up worth filing

Investigate why the last-surface→last-workspace→window close cascade doesn't complete in the test host. Either it's a headless limitation worth documenting in the test itself, or it's a real bug that only CI has ever noticed.

Test plan

  • bash -n clean
  • Skip wiring restored identically in both stateful and serial modes
  • git diff main on the script is comment-only
  • CI green

arzafran added 2 commits July 30, 2026 20:07
…orkspace

The skip carried no reason. Line 19 set STATEFUL_TEST_SKIP with no comment, and
the commit that introduced it says nothing about it -- while the quarantine list
directly below carries several paragraphs explaining itself. So one test has
been silently excluded from CI with no rationale anyone could check, which
leaves it in the worst state available: neither fixed nor deleted, and no way to
tell which it should be.

The likeliest cause was timing. It asserted the window was gone after a single
fixed 0.05s run-loop spin -- the same failure mode that made this whole class
flaky enough to need a retry. #218 converted it to wait for
`window(withId:) == nil` with a 2s budget, so that cause should be gone.

Un-skipped to find out. If it fails for some other reason, the skip goes back
WITH the reason written down.

Refs #186
Un-skipping it (previous commit) answered the question the skip could not: it
does not flake, it fails.

  AppDelegateShortcutRoutingTests.swift:1463: failed - Timed out waiting for
    Cmd+W on the last surface to close the window
  AppDelegateShortcutRoutingTests.swift:1465: XCTAssertNil failed: "<NSWindow: 0x...>"

It waits the full 2s that #218 gave it and the window is still there, so more
time does not help. The shortcut itself dispatches -- the XCTAssertTrue on
debugHandleCustomShortcut just above passes. And headless window closing works
in general: two sibling Cmd+Ctrl+W tests close real windows on the same runner
and are not skipped.

That narrows it to the cascade this test exercises -- close last surface, close
last workspace, close window -- and leaves open whether it is a headless-only
gap or a real bug in a path users rely on.

Restores the skip so CI stays green, with all of that written down. The wiring
is byte-identical to before; the diff is comment-only.

Refs #186
@arzafran arzafran changed the title test: stop skipping testCmdWClosesWindowWhenClosingLastSurfaceInLastWorkspace test: record why testCmdWClosesWindowWhenClosingLastSurfaceInLastWorkspace is skipped Jul 30, 2026
@arzafran
arzafran merged commit e5d73ab into main Jul 30, 2026
10 checks passed
@arzafran
arzafran deleted the test/186-unskip-cmdw-close branch July 30, 2026 23:48
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