Repository navigation
test(zero-swift): wait out a connect attempt a stalled system service holds up - #128
Merged
Merged
Conversation
… holds up TransportProbeTests.clientReconnectsAfterTheServerGoesAwayMidFrame and AppLifecycleTests.hiddenDisconnectsAndShownReconnects flaked on the iOS Simulator: a URLSession connect attempt never reached the in-process server, and the test gave up as the client's connect timeout (10 s) ended it, before the client's own retry, 250–500 ms later. Freezing the simulator's configd_sim reproduces both failures line for line, with the process running: the server sees no connection, the client logs "Connecting to …" and then the timeout. The lifecycle test waited 10 s for a connection. The probe waited 15 s, but URLSession only sees a frame cut by the server's FIN when the client next writes, its ping 5 s in, so the reconnect had under 10 s. Waits for a connection now cover one timed-out attempt and the first retry: the connect timeout, the retry's longest wait, and 2 s, plus the ping interval in the probe. Under the same freezes both tests failed before and pass now, and the client connects on its own retry. The probe's failure output now says how many TCP connections the server accepted, which tells a reconnect that never reached the server from one whose request didn't arrive. Amp-Thread-ID: https://ampcode.com/threads/T-0d2ed206-a5dd-4f42-9b68-c56e6b23e8f6 Co-authored-by: tmm <tmm@tmm.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two iOS Simulator flakes:
TransportProbeTests.clientReconnectsAfterTheServerGoesAwayMidFrame(urlSession, text), PR #122 run, and before that on Nov 6AppLifecycleTests.hiddenDisconnectsAndShownReconnects, PR #124 run, and before that on Nov 6Cause. In both, a URLSession connect attempt never reached the in-process test server. The probe's server saw no second upgrade request. The lifecycle server logged
listener readyand neveraccepted. The client handled it as designed: the 10 s connect timeout ends the attempt, and the client retries 250–500 ms later, as zero-client does. Both tests gave up at that same moment:pingTimeoutMs), so the reconnect starts at about 5.0 s (ts=5104 and ts=5042 in the CI logs) and gets under 10 s.Freezing the simulator's
configd_sim(SIGSTOP) reproduces both CI logs line for line while the test process keeps running. The lifecycle test's stop detector stays silent, as it did in CI. Both flakes predate the fast-reconnect port (#121), and neither goes through its backoff.Change.
pingTimeoutMsin the probe. The windows come from the client's constants.Verification (iOS 26.2 simulator, Xcode 26.3):
configd_simfrozen 16 s from the probe's first connectiontcpAccepted 1configd_simfrozen 11.5 s from the lifecycle test's startAppLifecycleTestsandTransportProbeTests, no freezeTest-only, so no changeset.