Daily iOS
Testing

Trustworthy tests on CI

In a delivery app's iOS project the unit tests and UI tests pass locally but fail now and then only on CI. How would you cut down these flaky tests?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Rerun with -test-iterations until the failure reproduces to find the cause, pin down whatever is nondeterministic from run to run (time, network, randomness, shared UserDefaults) with injection and fixtures, and don't paper over it with a retry option.

Share a question