cmux-next tests: window-cleanup trait on the 10 suites that open windows (base red)

Merged
TE
3d ago
+34-11

What failed

WindowCleanupCoverageTests.everySuiteThatOpensAWindowClosesWhatItLeaves (WindowCleanupCoverageTests.swift:33) fails on the tip "cmux-next swift test" run 41409695398 at ebe3b1ad7f19: suites that open windows lack .closesItsWindows. The run named 7:

  • CmuxNextAppTests: BlockingDialogMissedKeyTests, CloseKeyNoButtonFlashTests, FocusedPaneShowsFirstTests
  • CmuxNextBrowserTests: CEFDevToolsBackgroundTests, CEFDevToolsDockSideTests, CEFDevToolsStandInTests
  • CmuxNextDesignTests: DialogInitialFocusTests

Three more landed after that run and fail the same check on current base: CEFDevToolsCloseTests (#32032), CEFFirstPaintBaseTests (#31868), TabDropRollbackTests (#25694).

Cause

#27236 added the coverage check. These suites were added after it, without the trait.

Fix (test files only)

  • All 10 suites get .closesItsWindows on the top-level suite (and import CmuxNextTestSupport).
  • Each suite closes every window it opens, so adding the trait does not cause a new suite-level leak failure:
    • The five CEF rigs (Rig.close()) only removed the window's subviews and never closed the window. They now call window.closeAfterTest(). Closing hides the window, and the trait would count a window that was only hidden as a leak. The rigs are still kept alive until the process ends (the unowned runtime crash note still applies).
    • The BlockingDialogMissedKeyTests fixture also closes the WindowOverlayHost panel its dialogs were shown on. This is the same teardown as StripScrollbarAbovePageTests and PageGeometryPostTests.
    • The other suites already close their windows in a defer.

The scanner was right about every suite, so it is unchanged.

Risk

Test-only and small. The only change in behavior is that test windows now close at teardown. The PR's own "cmux-next swift test" run covers the changed suites.

Agent session: agent session

šŸ¤– Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Adds the .closesItsWindows trait to the ten cmux-next test suites that open windows, so WindowCleanupCoverageTests.everySuiteThatOpensAWindowClosesWhatItLeaves stops failing on the feat-cmux-next base.

The suites previously left their windows open; they now close them at teardown.

  • The five CEF rigs (Rig.close()) only removed subviews from the window; they now call window.closeAfterTest() so the window is actually closed, not just emptied.
  • The BlockingDialogMissedKeyTests fixture now also closes the WindowOverlayHost panel its dialogs were shown on.
  • The remaining suites already closed their windows in a defer and only needed the trait added.
  • Each suite imports CmuxNextTestSupport for closeAfterTest().

Test-only change; the "cmux-next swift test" run covers the modified suites.