Test repetitions
new in Xcode 13
allow you to repeat a test up to a specified number of iterations with a stopping condition
Three test repetition modes:
Fixed iterations
will repeat your tests a fixed number of times regardless of the outcome status
great for understanding the reliability of your test suite and helping keep it reliable as new tests are introduced over time
Until failure
will repeat a test until it fails
useful to reproduce a nondeterministic test failure to catch it in the debugger
Retry on failure
will retry your test until it succeeds up to a specified maximum
useful to identify unreliable tests which fail initially but eventually succeed on reattempt
To enable, either:
specify the mode within a test plan
control+click on a test diamond in your test file and choose the menu Run “test…()” Repeatedly…
on the terminal
xcodebuild test -project ....xcodeproj -scheme ... -destination '...' -test-iterations 100 -run-tests-until-failureThe xcodebuild test repetition flags are:
-test-iterations <number>
-retry-tests-on-failure
-run-tests-until-failure