From 00c2668f5633faf3c33ef7097c6d8f02a1981b54 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Fri, 23 Oct 2026 20:17:10 +0300 Subject: [PATCH] Speed up CI test retries and skip diagnostics collection on failure Drop -test-repetition-relaunch-enabled from the run-tests command. With it, xcodebuild re-runs the whole test selection after any failure, even though Swift Testing (6.4+) already retries just the failing test case in-process. The tradeoff is that a runner crash is no longer retried. Set diagnosticCollectionPolicy to Never in the UnitTests and PreviewTests plans. On any recorded issue xcodebuild otherwise tries to collect simulator diagnostics, which locally timed out after 600 seconds. IntegrationTests keeps its Always policy. --- PreviewTests/SupportingFiles/PreviewTests.xctestplan | 1 + Tools/Sources/Commands/CI/RunTests.swift | 3 +-- UnitTests/SupportingFiles/UnitTests.xctestplan | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/PreviewTests/SupportingFiles/PreviewTests.xctestplan b/PreviewTests/SupportingFiles/PreviewTests.xctestplan index a20468b30..0203cee4d 100644 --- a/PreviewTests/SupportingFiles/PreviewTests.xctestplan +++ b/PreviewTests/SupportingFiles/PreviewTests.xctestplan @@ -27,6 +27,7 @@ ], "defaultOptions" : { "defaultTestExecutionTimeAllowance" : 60, + "diagnosticCollectionPolicy" : "Never", "environmentVariableEntries" : [ { "key" : "IS_RUNNING_UNIT_TESTS", diff --git a/Tools/Sources/Commands/CI/RunTests.swift b/Tools/Sources/Commands/CI/RunTests.swift index 2832b53ed..3dd944fe8 100644 --- a/Tools/Sources/Commands/CI/RunTests.swift +++ b/Tools/Sources/Commands/CI/RunTests.swift @@ -147,12 +147,11 @@ struct RunTests: AsyncParsableCommand { // Use xcodebuild's native retry support to re-run only failing tests // instead of re-running the entire suite. retries=0 means no retries (single run). + // No -test-repetition-relaunch-enabled: it re-runs the whole selection after any failure. if retries > 0 { // -test-iterations is the total number of attempts (initial + retries) command += " -retry-tests-on-failure" command += " -test-iterations \(retries + 1)" - // Ensure retries still happen when a runner exits early. - command += " -test-repetition-relaunch-enabled YES" } if let testName { diff --git a/UnitTests/SupportingFiles/UnitTests.xctestplan b/UnitTests/SupportingFiles/UnitTests.xctestplan index 9000975c3..d731044a8 100644 --- a/UnitTests/SupportingFiles/UnitTests.xctestplan +++ b/UnitTests/SupportingFiles/UnitTests.xctestplan @@ -10,6 +10,7 @@ ], "defaultOptions" : { "defaultTestExecutionTimeAllowance" : 60, + "diagnosticCollectionPolicy" : "Never", "environmentVariableEntries" : [ { "key" : "IS_RUNNING_UNIT_TESTS",