8000 fix(minimald): follow the bound port in the transient-publish test by gominimal-aw-bot[bot] · Pull Request #1965 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(minimald): follow the bound port in the transient-publish test - #1965

Merged
norrietaylor merged 3 commits into
mainfrom
inbox-patch/886-proxy-get-connect-retry-a39f04eda5f24c65
Oct 5, 2026
Merged

norrietaylor merged 3 commits into
mainfrom
inbox-patch/886-proxy-get-connect-retry-a39f04eda5f24c65

Conversation

@gominimal-aw-bot
@gominimal-aw-bot gominimal-aw-bot Bot commented Oct 4, 2026 •
Copy link
Copy Markdown
Contributor

Summary

Fixes a flaky test in crates/minimald/src/server.rs: a_transient_publish_failure_keeps_the_default_port panicked with ConnectionRefused (Os 111) when it connected to the probed default port.

The test picks a free port by binding a probe and dropping it, then hands that port to the proxy as its default. Between the drop and the proxy's bind, another process can take the port; NET-025 then relocates the bind ("selecting a free one") and nothing listens on the probed port. The test only connects after it has logged two failed publishes, so the listener is already accepting by then: a refused connect means the listener was not on the probed port, not that the accept loop was late.

Change

  • The test reads the bound port from the publish warning's guest_port= field and connects there.
  • It asserts guest_port == default_port unless the bind relocated (the log contains "selecting a free one").
  • On either path, it asserts that every failed publish proposed host_port == guest_port == bound_port, so a transient publish failure is still shown to keep the bound port with no walk.
  • proxy_get is unchanged. This is a test-only change; no production code is touched.

Verification

CI's Linux lanes are the proof: the test is #[cfg(target_os = "linux")] and minimald does not build natively on macOS.

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABU-ETRg

Summary by CodeRabbit

  • Tests
    • Updated transient-publish checks to use the listener’s actual bound port, including when it differs from the probed default.
    • Verify that failed publish attempts report the bound port for both host and guest ports.

The proxy's serve task is spawned the moment its listener binds, so a
connect can land before the accept loop is ready (or, on a busy host,
after another process took the probed port). proxy_get unwrapped the
first connect, so a_transient_publish_failure_keeps_the_default_port
flaked with ConnectionRefused (Os 111).

Retry the connect briefly (5s timeout, 10ms backoff on
ConnectionRefused) instead of unwrapping the first attempt.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gominimal-aw-bot gominimal-aw-bot Bot added the agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. label Oct 4, 2026
@gominimal-aw-bot
gominimal-aw-bot Bot requested a review from a team as a code owner October 4, 2026 20:40
@gominimal-aw-bot gominimal-aw-bot Bot added the agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. label Oct 4, 2026
@gominimal-aw-bot
Copy link
Copy Markdown
Contributor Author

[inbox-patch:clobber]

This PR would revert recently merged work

Simulating this merge shows it undoing commits that landed on the base branch within the last 3 day(s):

  • d2a78b425 — 100% of its 8 surviving lines in these files would be undone
    • T79 — Drop a box's flows to the switch's own addresses in the shared verdict (T79 — Drop a box's flows to the switch's own addresses in the shared verdict #1943)
      This is the stale-read failure, not a conflict: the agent read these files before the commits above merged, then wrote the whole region back from that stale read. Git applies it cleanly, so there is no conflict, no failing test, and nothing unusual in the diff summary — see gominimal/inbox#460.

Before merging, restore the reverted region to its state on the base branch. The rest of this PR is unaffected.

If a listed commit is one this PR intends to supersede, say so and merge — this check reports, it does not block.

@coderabbitai
coderabbitai Bot commented Oct 4, 2026 •
8000
Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: ece77ff7-4c51-4240-aee9-ec7388bffa6e
📥 Commits

Reviewing files that changed from the base of the PR and between e3ca896 and 07d3be7.

📒 Files selected for processing (1)
  • crates/minimald/src/server.rs

Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The transient-publish test now reads the listener’s bound port from the publish warning. It uses that port to check failed publish suggestions and listener availability. It checks the default port only when the warning does not report a relocation.

Changes

Transient publish test

Layer / File(s) Summary
Check the reported bound port
crates/minimald/src/server.rs
The test reads the bound port from the warning. It checks the default only when no relocation is reported, verifies failed publishes suggest the bound port for both host and guest ports, and probes the listener at that port.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: norrietaylor

Merge Risk: ⚪ Minimal · up to 07d3b

No actionable merge-blocking issue is identified. Run the Linux test as part of normal checks before merging.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the test change: it says the transient-publish test now follows the bound port. It is concise and uses the required Conventional Commit format.
Description check ✅ Passed The description explains the race, the test changes, and the Linux-only verification context. It does not include a specific test command or result, and it omits the template checklist, but the main i…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the port with care,
The warning tells which one is there.
Both host and guest now match the sign,
The listener answers right on time.
One hop, one probe, the test is done.

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

@gominimal-aw-bot gominimal-aw-bot Bot added the agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch label Oct 4, 2026
The ConnectionRefused flake is not a connect racing the accept loop:
the listener is bound (and listening) before any publish attempt, and
the test only connects after two publish failures. It happens when a
parallel process takes the probed port before the bind, so NET-025
relocates the bind and nothing listens on the probed port; a connect
retry cannot recover from that. Read the bound port off the publish
warning, connect there, and hold it to the probed port whenever the
bind did not relocate. Drop the proxy_get retry.
@norrietaylor norrietaylor changed the title fix: fix(minimald): retry proxy connect in proxy_get test helper fix(minimald): retry proxy connect in proxy_get test helper Oct 4, 2026
@norrietaylor norrietaylor changed the title fix(minimald): retry proxy connect in proxy_get test helper fix(minimald): follow the bound port in the transient-publish test Oct 4, 2026
@norrietaylor
Copy link
Copy Markdown
Member

Pushed b27e1ea, which replaces the connect retry. The ConnectionRefused is not a connect racing the accept loop: drive_proxy_until_serving binds the listener with TcpListener::bind (bind and listen) and spawns the serve task before any publish attempt (server.rs ~1889-1905), and the test connects only after two publish failures. So the kernel would queue the connect even if accept had not run yet. The refusal comes from a parallel process taking the probed port between drop(probe) and the bind: NET-025 then relocates the bind ("the default hostname-proxy port is busy; selecting a free one"), and nothing ever listens on the probed port. A retry cannot recover from that and would only turn into a 5 s timeout panic. The test now reads the bound port from the publish warning's guest_port=, connects there, and asserts it equals the probed port whenever the bind did not relocate. proxy_get is back to a single connect.

@norrietaylor
Copy link
Copy Markdown
Member

/review

@minimal-foundry
minimal-foundry Bot commented Oct 5, 2026 •
< 8000 span class="Button-content"> Copy link
Copy Markdown
Contributor

Approved: no findings at 07d3be7b06a3.

Nothing to do.

Clobber: none: the surrounding proxy_get retry helper is from the prior commit e3ca896 and is left intact; this change builds on it.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approved

Verdict APPROVE — No findings.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 5, 2026
@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Third review applied; CI green, minimal-review approved.

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 5, 2026
@norrietaylor
norrietaylor removed this pull request from the merge queue due to a manual request Oct 5, 2026
@norrietaylor
norrietaylor added this pull request to the merge queue Oct 5, 2026
Merged via the queue into main with commit 76e522c Oct 5, 2026
34 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/886-proxy-get-connect-retry-a39f04eda5f24c65 branch October 5, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

535C
agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch clobber-suspected review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0