fix(test): retry loopback accept in stale-session poll tests - #305
Conversation
macOS Cross-Platform CI failed because TcpStream::connect() can return before the listener's non-blocking accept() sees the socket. Use the existing accept_pending_connections helper in poll teardown tests and related cap tests. Co-authored-by: Alexander Wagner <info@alexanderwagnerdev.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_15baf00f-e2ea-4cca-940e-2e630da6e0d8) |



Summary
macOS Cross-Platform CI on PR #304 failed in
server::tests::paused_players_are_closed_during_pollbecauseTcpStream::connect()can return before the listener's non-blockingaccept()sees the socket.Changes
accept_pending_connectionshelper in stale-session poll teardown testsTest plan
cargo test (macOS, all features)passesNote
Low Risk
Only test harness timing changes; no production server or accept-path behavior is modified.
Overview
Test-only hardening for loopback TCP acceptance races (especially on macOS), where
TcpStream::connect()can succeed before the server's non-blockingaccept()sees the socket.Server tests that set up connections now call
accept_pending_connectionsinstead of a singleaccept_new_connections()plus an immediate length assert. That helper retries accepts with a short sleep until the expected connection count is reached or a 2s deadline.The max global connections and per-IP cap tests use the same retry loop when asserting a third client stays rejected, so flaky CI from timing is avoided without changing server admission logic.
Reviewed by Cursor Bugbot for commit 008ceb8. Bugbot is set up for automated code reviews on this repo. Configure here.