Skip to content

test(minvmd): stop the node-port test racing a parallel test for its released port (T95) - #2660

Merged
norrietaylor merged 1 commit into
mainfrom
agent/2653-stop-node-port-assigned-on-host-and-handed-to-da
Oct 27, 2026
Merged

norrietaylor merged 1 commit into
mainfrom
agent/2653-stop-node-port-assigned-on-host-and-handed-to-da

Conversation

@minimal-foundry

Copy link
Copy Markdown
Contributor

T95 — Stop node_port_assigned_on_host_and_handed_to_daemon racing a parallel test for its port

slice: S13
kind: enablement
covers: none
size: S
est: 20 code, 60 tests
executor: agent
difficulty: routine
model: standard
diagnostics: none: the task changes a unit test, so no tool prints anything new.
observability: none: the task changes a unit test, so no trace, metric or log line changes.
layers:
- flake:
- crates/minvmd/src/cmd/run.rs: the step that releases a port and expects assign_node_port to hand it back as asked no longer fails when another test in the process takes the released port first (#2653)
test: cargo nextest run -p minvmd node_port_assigned_on_host_and_handed_to_daemon
produces: none
consumes: none
proof: node_port_assigned_on_host_and_handed_to_daemon passes under a loaded parallel run.


Generated by Claude Code

Proof

node_port_assigned_on_host_and_handed_to_daemon in crates/minvmd/src/cmd/run.rs no longer fails when a parallel test binds the port it just released. The step releases a fresh port and asks again, up to 16 times. A probe that refuses every free port still fails the test.

Notes from the agent: The pin step later in the same test has the same release-then-expect race, so it gets the same retry. The test file is the same file, so the scope does not change. I did not reproduce the race under load on this box. The fix removes the window by retrying, and it does not depend on timing. cargo clippy -p minvmd --all-targets is clean, and cargo fmt made no other changes.

Tests

line exit tail
cargo nextest run -p minvmd node_port_assigned_on_host_and_handed_to_daemon 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-5c23... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling version v0.8.0 (/workbenc

Verify

min task run agent-verify passed ([tasks.verify]).

Closes #2653

node_port_assigned_on_host_and_handed_to_daemon released a port and
expected assign_node_port to hand it back. A parallel test could bind
it in between. The free-port step and the pin step now release a fresh
port and ask again, up to 16 times. (#2653)
@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

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

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f8ef29fd-c579-472f-a686-230caa5efab5

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@minimal-foundry

minimal-foundry Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Approved: no findings at ffdd5e5a61c4.

Nothing to do.

Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it.

Clobber: none.

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

arch-review: PASS · the full ruling

The design of record says nothing about how a unit test picks a free port, so this is a PASS by absence. The change edits only the test node_port_assigned_on_host_and_handed_to_daemon. The port-assignment gates do not change, and the configured pin still never redraws. Each retry asserts the same outcome as before. A probe that refuses every free port still fails the test.

Ruled at ffdd5e5 against gominimal/arch@109541a48c31 by claude-opus-5-5.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

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.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 27, 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.

Own review at ffdd5e5. node_port_assigned_on_host_and_handed_to_daemon now treats a released port that another test took first as a lost race, not a wrong answer. Both the free-port step and the pinned-port step release a fresh port and ask again, up to NODE_PORT_RACE_ATTEMPTS (16) times. A probe that refuses every free port still fails after the last attempt, and the pin step's panic names the last refusal. Only the test changes.


Generated by Claude Code

@norrietaylor norrietaylor changed the title T95 — Stop node_port_assigned_on_host_and_handed_to_daemon racing a parallel test for its port test(minvmd): stop the node-port test racing a parallel test for its released port (T95) Oct 27, 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.

Babysitter approval at ffdd5e5: every merge gate passes at this head (arch PASS at ffdd5e5, zero open threads, every lane aggregator green). Squash title test(minvmd): stop the node-port test racing a parallel test for its released port (T95) and the squashed message pass commitlint. Queued for squash merge.


Generated by Claude Code

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit d3d21a4 Oct 27, 2026
37 checks passed
@norrietaylor
norrietaylor deleted the agent/2653-stop-node-port-assigned-on-host-and-handed-to-da branch October 27, 2026 04:52
gominimal-aw-bot Bot added a commit that referenced this pull request Nov 10, 2026
The held_configured_port_starts_the_vm_with_the_proxy_down test
releases an ephemeral port and immediately asserts the reclaim
check takes it. Another test running in the same process can bind
the freed port in that window; the check then correctly answers
Skip and the assertion fails.

Bind a fresh ephemeral pin per attempt and retry up to
NODE_PORT_RACE_ATTEMPTS times, mirroring d3d21a4 (#2660), which
fixed the same race for sibling tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
yermakoffivan pushed a commit to yermakoffivan/minimal that referenced this pull request Nov 16, 2026
…reed pin (gominimal#3222)

* test(minvmd): retry the reclaim check's freed pin another test took

The held_configured_port_starts_the_vm_with_the_proxy_down test
releases an ephemeral port and immediately asserts the reclaim
check takes it. Another test running in the same process can bind
the freed port in that window; the check then correctly answers
Skip and the assertion fails.

Bind a fresh ephemeral pin per attempt and retry up to
NODE_PORT_RACE_ATTEMPTS times, mirroring d3d21a4 (gominimal#2660), which
fixed the same race for sibling tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test(minvmd): ask the reclaim check about the released pin first

The retry loop asked the check about a fresh freed port on every
attempt and never about the pin once its holder exited, so the sentence
the test is named for, that the pin the VM was handed is reclaimed when
its holder exits, was no longer checked. The pin is the first question
again. Only when the check answers Skip, another test having taken the
port in the window, does the test fall back to fresh freed ports for
the remaining attempts, and the assertion says which case failed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* chore(worker-iterate): address CodeRabbit findings on PR gominimal#3222

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(worker-iterate): address CodeRabbit findings on PR gominimal#3222

Only a reservation taken by proxy_reclaim_check itself satisfies the
reclaim assertion; the diagnostic verdict names the race but never stands
in for the check's answer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(worker-iterate): address CodeRabbit findings on PR gominimal#3222

---------

Co-authored-by: gominimal-aw-bot[bot] <281738952+gominimal-aw-bot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: bryan <bryan@minimal.dev>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T95 — Stop node_port_assigned_on_host_and_handed_to_daemon racing a parallel test for its port

1 participant