Repository navigation
test(minvmd): stop the node-port test racing a parallel test for its released port (T95) - #2660
Conversation
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)
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Approved: no findings at 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. |
There was a problem hiding this comment.
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.
norrietaylor
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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
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>
…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>
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_portto 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
cargo nextest run -p minvmd node_port_assigned_on_host_and_handed_to_daemonVerify
min task run agent-verifypassed ([tasks.verify]).Closes #2653