From f1de706e7c78e2cb37ed95c55282f17b0d1fad32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emek=20Vysok=C3=BD?= Date: Thu, 3 Mar 2022 16:17:52 +0100 Subject: [PATCH] Warn about broken exit code detection in iOS 15+ (#829) --- .../Orchestration/RunOrchestrator.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Microsoft.DotNet.XHarness.Apple/Orchestration/RunOrchestrator.cs b/src/Microsoft.DotNet.XHarness.Apple/Orchestration/RunOrchestrator.cs index 27f29a639ef10c..2771e6e30ff304 100644 --- a/src/Microsoft.DotNet.XHarness.Apple/Orchestration/RunOrchestrator.cs +++ b/src/Microsoft.DotNet.XHarness.Apple/Orchestration/RunOrchestrator.cs @@ -126,6 +126,18 @@ Task ExecuteMacCatalystApp(AppBundleInformation appBundleInfo) Task ExecuteApp(AppBundleInformation appBundleInfo, IDevice device, IDevice? companionDevice) { + // Exit code detection is broken on the newest iOS + // More details here: https://github.com/dotnet/xharness/issues/819 + if (expectedExitCode != 0) + { + var os = target.Platform.IsSimulator() ? device.OSVersion.Split(' ', 2).Last() : device.OSVersion; + if (Version.TryParse(os, out var version) && version.Major > 14) + { + _logger.LogWarning( + "Exit code detection is not working on iOS/tvOS 15+ so the run will fail to match it with the expected value"); + } + } + appRunStarted = true; return this.ExecuteApp( appBundleInfo,