Skip to content

test(native): tolerate a reused port in the loopback probe test - #644

Merged
roodboi merged 2 commits into
nextfrom
claude/hack-1946-port-probe-flake
Nov 7, 2026
Merged

roodboi merged 2 commits into
nextfrom
claude/hack-1946-port-probe-flake

Conversation

@roodboi

@roodboi roodboi commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

provider::publication::port_probe_tests::loopback_probe_refuses_exact_and_wildcard_listeners_and_accepts_a_free_port fails intermittently on next CI with published_port_in_use. It has been seen on macOS-latest and on ubuntu-latest, the latter on #642, which changes no Rust.

Cause: the free-port half of the test released a listener and then probed that same port. A parallel test can bind the ephemeral port in between, and a loaded runner can time out the 250 ms connect. The probe treats either case as "in use", which is correct for the product but makes this test flaky.

Change: test only. The test now releases up to 20 fresh ephemeral ports and passes as soon as the probe clears one. It still fails if the probe never accepts a free port. The exact-listener, wildcard-listener and port-0 assertions are unchanged, and require_loopback_port_free is untouched.

Validation: cargo +1.97.1 fmt --check, cargo +1.97.1 clippy --all-targets -D warnings, and the focused test pass locally on macOS. Gitleaks found no leaks. CI on this PR covers Linux.

Also in this PR (HACK-1721): three doctor --fix tests in tests/doctor-fix-noninteractive.test.ts used Bun's 5 s default, while the rest of the file already allows 30 s. They now allow 30 s too. On this PR's first CI run, the stale-daemon-pid case finished about 60 ms after the 5 s limit. Locally, all 27 tests in that file pass.

Refs HACK-1946, HACK-1721

🤖 Generated with Claude Code


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

The free-port half of the loopback probe test reprobed the exact port it
had just released. A parallel test can bind that ephemeral port first, and
a loaded runner can time out the connect; both read as in use. The test now
accepts the first of several freshly released ports the probe clears.

Refs HACK-1946

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

HACK-1946

HACK-1721

Three tests in doctor-fix-noninteractive used Bun's 5 s default while the
rest of the file already allows 30 s. A loaded CI runner finished the
stale-daemon-pid case about 60 ms past 5 s.

Refs HACK-1721

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roodboi

roodboi commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 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-07T19:42:34.381502Z 51c649f Manual request
🔒 Security Review ✅ Completed 2026-11-07T19:43:53.903056Z 51c649f Manual request
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 51c649fd91

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 51c649fd91

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@roodboi
roodboi merged commit 44e702d into next Nov 7, 2026
27 checks passed
@roodboi
roodboi deleted the claude/hack-1946-port-probe-flake branch November 7, 2026 19:46
roodboi added a commit that referenced this pull request Nov 7, 2026
Brings in #643 and #644, which also touch provider/lifecycle.rs and the
native candidate guide. clippy -D warnings and provider tests pass after
the merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant