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.
This commit is contained in:
Stefan Ceriu
2026-10-23 20:17:10 +03:00
parent 3631120321
commit 00c2668f56
3 changed files with 3 additions and 2 deletions
@@ -27,6 +27,7 @@
],
"defaultOptions" : {
"defaultTestExecutionTimeAllowance" : 60,
"diagnosticCollectionPolicy" : "Never",
"environmentVariableEntries" : [
{
"key" : "IS_RUNNING_UNIT_TESTS",
+1 -2
View File
@@ -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 {
@@ -10,6 +10,7 @@
],
"defaultOptions" : {
"defaultTestExecutionTimeAllowance" : 60,
"diagnosticCollectionPolicy" : "Never",
"environmentVariableEntries" : [
{
"key" : "IS_RUNNING_UNIT_TESTS",