cmux-next tests: window-cleanup trait on the 10 suites that open windows (base red)
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
.closesItsWindowson the top-level suite (andimport 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 callwindow.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 (theunownedruntime crash note still applies). - The BlockingDialogMissedKeyTests fixture also closes the
WindowOverlayHostpanel 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 five CEF rigs (
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](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
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 callwindow.closeAfterTest()so the window is actually closed, not just emptied. - The
BlockingDialogMissedKeyTestsfixture now also closes theWindowOverlayHostpanel its dialogs were shown on. - The remaining suites already closed their windows in a
deferand only needed the trait added. - Each suite imports
CmuxNextTestSupportforcloseAfterTest().
Test-only change; the "cmux-next swift test" run covers the modified suites.