diff --git a/Tests/Reality/RealDesktopFirstRun.swift b/Tests/Reality/RealDesktopFirstRun.swift index dc965230..c4688d18 100644 --- a/Tests/Reality/RealDesktopFirstRun.swift +++ b/Tests/Reality/RealDesktopFirstRun.swift @@ -130,10 +130,12 @@ func checkRealDesktopFirstRun(_ session: RealitySession, interrupted: () -> Bool try await capture("03-tidy") let visible = desktopVisibleFrames() try encodeJSON(visible, to: directory.appendingPathComponent("visible-frames.json")) - let deadline = ContinuousClock.now.advanced(by: .seconds(20)) + // Independent per-app AX probes and CLI diagnostics can outlast product settlement. + let deadline = ContinuousClock.now.advanced(by: .seconds(60)) var previous: [DesktopWindow] = [] var stable = 0 var layoutFailures: [String] = [] + var stabilityChanges: [String] = [] repeat { try checkCancellation() let status = try await nativeTourStatus(session) @@ -174,7 +176,8 @@ func checkRealDesktopFirstRun(_ session: RealitySession, interrupted: () -> Bool if !status.isBusy, let terminal = status.terminal, terminal != "none", terminal != "success" { throw RealityError("Tidy outcome: \(terminal); \(status.visibleSetupText)") } - let stableFrames = RealDesktopOracle.changes(before: previous, after: report.after, frames: true).isEmpty + stabilityChanges = RealDesktopOracle.changes(before: previous, after: report.after, frames: true) + let stableFrames = stabilityChanges.isEmpty stable = !previous.isEmpty && stableFrames && layoutFailures.isEmpty && status.terminal == "success" && !status.isBusy && !status.presented ? stable + 1 : 0 @@ -183,7 +186,11 @@ func checkRealDesktopFirstRun(_ session: RealitySession, interrupted: () -> Bool if stable >= 3 { break } try await Task.sleep(for: .milliseconds(100)) } while ContinuousClock.now < deadline - guard stable >= 3 else { throw RealityError("Tidy did not settle into verified tiles: \(layoutFailures)") } + guard stable >= 3 else { + throw RealityError( + "Tidy did not settle into verified tiles: \(layoutFailures); stable=\(stable); changes=\(stabilityChanges)" + ) + } try await requireNativeAutomatic(session, enabled: true) report.automaticTiling = true report.failures += RealDesktopOracle.changes(before: report.before, after: report.after, frames: false)