Skip to content

test(zero-swift): show the test server's side when an app lifecycle test times out - #115

Merged
tmm merged 1 commit into
mainfrom
swift-lifecycle-trace
Nov 7, 2026
Merged

tmm merged 1 commit into
mainfrom
swift-lifecycle-trace

Conversation

@tmm

@tmm tmm commented Nov 7, 2026

Copy link
Copy Markdown
Member

The app lifecycle tests time out now and then in the iOS Simulator: 4 of about 60 recent "Swift end-to-end (macOS)" runs, a different test each time. The test either waits for "connected" or for "the socket closed".

In both of the failures that wait for "connected", the client logged "Connecting to ws://127.0.0.1:…" and "Waiting for connection to be acknowledged". It never logged "Got socket open event", so the WebSocket upgrade to the test's local server never finished. In one of them, the client retried after its 10-second connect timeout, as it should. The test also gives up after 10 seconds, so it fails before that retry.

What's missing is the server's side: whether the listener accepted the connection, and whether it reached ready. This PR writes the server's listener and connection events to the same log the failure prints, so the next failure shows which side stalled.

It doesn't change any timeouts, because the cause isn't known yet.

Checked on a macOS 27 Mac:

  • I made a test fail on purpose, and its output now shows server: accepted, preparing, ready and open next to the client's lines.
  • With that removed, the lifecycle suite passes on macOS and in the iOS 27.2 Simulator.
  • I couldn't reproduce the flake: 40 passes in a row on iOS 27.2 under CPU load, and 3 on iOS 26.5 with a freshly booted simulator.

Test-only, so no changeset.

…est times out

The lifecycle tests' flake on the iOS Simulator (4 of about 60 macOS
runs) shows only the client's log: it sent the WebSocket upgrade and never
logged the socket opening, then timed out after 10 s, as the test did. The
local server's view, whether it accepted the connection and the upgrade
finished, wasn't recorded, so which side stalls is unknown. The server now
writes its listener and connection events to the same log the failure
prints.

Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859
Co-authored-by: tmm <tmm@tmm.dev>
@tmm
tmm merged commit 4fc60bc into main Nov 7, 2026
15 checks passed
@tmm
tmm deleted the swift-lifecycle-trace branch November 7, 2026 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants