cmux-next tests: DisplayBackdropBindingTests closes its windows (base red from #27092)
Merged
TE
3d ago+29+29+01234567890123456789-10-10-01234567890123456789
Base red: WindowCleanupCoverageTests.everySuiteThatOpensAWindowClosesWhatItLeaves fails in the tip Swift suite (run 41435160513, job 125243545517):
Expectation failed: (offenders ā ["CmuxNextSettingsTests/DisplayBackdropBindingTests.swift:7: DisplayBackdropBindingTests"]).isEmpty ā false
Cause: #27092 (per-display wallpaper rotation) added DisplayBackdropBindingTests, which makes NSWindows without .closesItsWindows and never closes them.
Fix (test-only, same pattern as #32086):
- Each test makes its window as a local and closes it with
closeAfterTest()in its own teardown, declared before the binding'sdeferso the binding stops first. - The suite takes
.closesItsWindowsand importsCmuxNextTestSupport. CmuxNextSettingsTestslinksCmuxNextTestSupport(Package.swift).
Base-red-job: cmux-next / cmux-next swift test
Changelog
none
Observed / Not run
- Ran
scripts/cmux-next/prepush-gate.py: no new violations. - Not run: the suite itself; this PR's own
cmux-next swift testis the evidence.
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
Fixes the Swift suite base red where DisplayBackdropBindingTests leaked NSWindows, failing WindowCleanupCoverageTests.
- Test-only change: each test closes its windows with
closeAfterTest(), declared before the binding'sdeferso the binding stops first. - The suite now takes
.closesItsWindows, andCmuxNextSettingsTestslinksCmuxNextTestSupportto provide it.