cmux-next tests: DisplayBackdropBindingTests closes its windows (base red from #27092)

Merged
TE
3d ago
+29-10

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's defer so the binding stops first.
  • The suite takes .closesItsWindows and imports CmuxNextTestSupport.
  • CmuxNextSettingsTests links CmuxNextTestSupport (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 test is the evidence.

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

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's defer so the binding stops first.
  • The suite now takes .closesItsWindows, and CmuxNextSettingsTests links CmuxNextTestSupport to provide it.