Skip to content

fix(test): retry loopback accept in stale-session poll tests - #305

Merged
AlexanderWagnerDev merged 1 commit into
mainfrom
cursor/ci-autofix-macos-paused-player-accept-race
Sep 18, 2026
Merged

AlexanderWagnerDev merged 1 commit into
mainfrom
cursor/ci-autofix-macos-paused-player-accept-race

Conversation

@cursor

@cursor cursor Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

macOS Cross-Platform CI on PR #304 failed in server::tests::paused_players_are_closed_during_poll because TcpStream::connect() can return before the listener's non-blocking accept() sees the socket.

Changes

  • Use the existing accept_pending_connections helper in stale-session poll teardown tests
  • Apply the same retry pattern to related max-connection and per-IP cap accept tests

Test plan

  • Cross-Platform cargo test (macOS, all features) passes
Open in Web View Automation 

Note

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-blocking accept() sees the socket.

Server tests that set up connections now call accept_pending_connections instead of a single accept_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.

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>
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ca9b2d59-e166-4f10-8617-3ace6752ce6c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@AlexanderWagnerDev
AlexanderWagnerDev marked this pull request as ready for review September 18, 2026 09:18
@AlexanderWagnerDev
AlexanderWagnerDev merged commit 1ef384f into main Sep 18, 2026
61 checks passed
@AlexanderWagnerDev
AlexanderWagnerDev deleted the cursor/ci-autofix-macos-paused-player-accept-race branch September 18, 2026 09:18
@cursor

cursor Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

Bugbot couldn't run - usage limit reached

Bugbot 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)

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