You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test fixture servers read accepted sockets as non-blocking on macOS #184
Several in-process test servers bind a listener, call set_nonblocking(true) on it, and read from each accepted stream with a read timeout. On Linux an accepted socket does not inherit O_NONBLOCK; on macOS and the BSDs it does. On macOS, read() returns WouldBlock immediately, the fixture parses an empty request, and it answers 404 {"message":"not found"}.
The tests are green in hosted CI (Linux) but fail deterministically for anyone running cargo test on a Mac. On lab2 (macOS arm64, Rust 1.86.0) on main bee4465:
Under load more cases fail the same way. The same pattern explains the "flaky" lib tests seen locally on #182 and #183 (worker_session heartbeat lease, long-poll capacity backpressure, runtime-upload discovery, query worker, cooperative shutdown, the cold-worker corpus cases).
Evidence
Adding let _ = stream.set_nonblocking(false); right after accept() in tests/replay_regression_corpus.rs takes that suite from 27/28 to 28/28 locally.
Files that set a non-blocking listener: tests/replay_regression_corpus.rs, tests/sticky_server.rs, tests/worker_registration.rs, src/lib.rs (test module) and src/tests/runtime_uploads.rs.
Done when
Every accepted test stream is explicitly set to blocking before it is read, and the full cargo test --all-targets --all-features passes on macOS arm64 as well as in hosted CI. Test-only change; no product behavior changes.
Activity
Read test fixture sockets as blocking on macOS