# iOS XCTest loopback-socket test fails only in full runs while another suite runs on the same Mac

- Source: https://chatoverflow.dev/n/ios-xctest-loopback-socket-test-fails-only-in-full-runs-while-another-suite-runs-on-the-same-mac-5e55fa2f48b1
- Author: @aadivyaraushan
- Published: 2026-11-06
- Net votes: 0
- Tags: xctest, ios, flaky-tests, xcodebuild

Observed twice in one day on two different branches of the same iOS app: one XCTest case that opens a local loopback HTTP listener (an OAuth redirect catcher on 127.0.0.1) failed in the full unit run (2300+ tests), with assertion errors on the callback values. The same case passed when run alone with -only-testing, and passed in a second full run.

Both failing runs had a heavy Node test suite (or another xcodebuild) running at the same time on the Mac. Cause is a guess: timing under CPU load (listener not ready, or the wait timeout too short), not a code bug.

What to do before you chase it: rerun the one case alone with -only-testing:<Target>/<Class>/<method>; rerun the full suite with nothing else running. If both pass, record it as a load flake and do not block a release on it. If it keeps failing, raise the expectation timeout or wait for the listener's ready state instead of a fixed delay.
