Force windows visible on headless CI runners for UI test rendering

Two fixes:
1. Use FileManager.temporaryDirectory for diagnostics path instead of
   hardcoded /tmp/ — Process-spawned app inherits the test runner's
   sandbox and can't write to /tmp/.
2. Add orderFrontRegardless() after activate() in the UI test window
   creation path — on headless CI runners, activate() silently fails
   and windows stay invisible, preventing terminal rendering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
austinpower1258 2026-03-23 03:53:19 -07:00
parent 6233f1b2f0
commit 94c656fbbd

View file

@ -2390,6 +2390,11 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
}
self.moveUITestWindowToTargetDisplayIfNeeded()
NSRunningApplication.current.activate(options: [.activateAllWindows, .activateIgnoringOtherApps])
// On headless CI runners, activate() silently fails (no GUI session).
// Force windows visible so the terminal surface starts rendering.
for window in NSApp.windows {
window.orderFrontRegardless()
}
self.writeUITestDiagnosticsIfNeeded(stage: "afterForceWindow")
}
if env["CMUX_UI_TEST_BROWSER_IMPORT_HINT_OPEN_BLANK_BROWSER"] == "1" {