Failure modes
Airplane Mode
Takes one app offline. In the iOS Simulator it behaves like a real device for apps launched with request monitoring:
- requests fail with “The Internet connection appears to be offline”,
NWPathMonitorreports no network,SCNetworkReachability(used by Alamofire and Reachability.swift) reports no network.
Connection failures
- Refuse connections: refuse a percentage of new connections.
- Time out: every request times out.
- Drop connections: drop connections after a number of seconds.
- Outages: go offline and come back, repeatedly.
Fail or mock one endpoint
In simulator apps, pick an endpoint and make it go offline, time out, return an HTTP status or respond with a delay, or mock it with a made-up response starting from the real one. The rest of the app keeps working. More about mocking endpoints.