Skip to content

fleet gh: keep the entry-point test's port so the cache-serve check stops flaking - #11470

Merged
dezren39 merged 1 commit into
mainfrom
fix/11296-gh-cache-port-race
Nov 18, 2026
Merged

dezren39 merged 1 commit into
mainfrom
fix/11296-gh-cache-port-race

Conversation

@dezren39

@dezren39 dezren39 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Closes #11296

Before: serve_entry_point_stays_up_and_caches bound 127.0.0.1:0, read the port, dropped the listener, and handed the address to serve() to bind again. On a busy machine another process can take the port in that gap, so the fleet check failed with "Address already in use" and broke the amd toplevel build.

After: the test never lets go of its port, so nothing else can take it. It still runs the same daemon body that fleet gh cache-serve runs.

How:

  • serve() binds, then calls a new serve_listener(backend, listener, label). That function holds what used to follow the bind: serve_on, then joining the accept thread. serve() behaves exactly as before.
  • The entry-point test binds port 0 and passes that listener to serve_listener. It still checks the task-17509 regression: the daemon answers, caches across connections, and doesn't return while the listener is healthy.
  • New test serve_exits_3_when_it_cannot_bind covers serve()'s own bind step. It holds an address and checks that serve() exits 3. The port stays held for the whole call, so there's no race.

Testing: cargo test -p fleet --bin fleet gh_cache passes locally (8 tests).


Generated by Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

serve_entry_point_stays_up_and_caches probed a port, dropped it, and
let serve() re-bind by address. Another process could take the port in
that window, which flaked the fleet check in the amd toplevel build
(Address already in use). serve() now binds and hands off to
serve_listener; the test drives serve_listener over a listener it never
releases, keeping its coverage of the join-not-exit path (task 17509).
A new test covers serve()'s bind step: a held address exits 3.

Closes #11296

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dezren39
dezren39 marked this pull request as ready for review November 18, 2026 01:25
@dezren39
dezren39 requested a review from a team as a code owner November 18, 2026 01:25
@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T01:26:42.058368Z bb4c0ff Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit a4cadc1 into main Nov 18, 2026
@dezren39
dezren39 deleted the fix/11296-gh-cache-port-race branch November 18, 2026 01:25
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.

fleet(gh_cache): serve_entry_point test flakes on probe-drop-rebind port race (blocks amd toplevel build)

2 participants