diff --git a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift index d152fa5cda..f02f005a39 100644 --- a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +++ b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift @@ -245,6 +245,15 @@ final class RunnerTests: XCTestCase { // MARK: - XCTest Entry +#if os(macOS) + // Xcode 27.2 aborts in CGS_REQUIRE_INIT on the first synthesized event unless the process is + // connected to the window server; the UI-test runner has no NSApplication to do it (#4142). + override class func setUp() { + super.setUp() + MainActor.assumeIsolated { _ = NSApplication.shared } + } + +#endif override func setUp() { continueAfterFailure = true }