apollo_infra_utils: probe test ports on the interface servers actually bind - #14954
apollo_infra_utils: probe test ports on the interface servers actually bind#14954asaf-sw wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit aa117aa. Configure here.
aa117aa to
571fc3a
Compare
Note on the
|
571fc3a to
44ad89f
Compare
…y bind Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
44ad89f to
9267186
Compare

Fixes the test port probe to use the interface the servers actually bind.
run-integration-testshas been red on main's nightly for 6+ consecutive nights withAddrInUse, because a holder on any non-loopback interface passed the old probe and then collided on bind.This closes the interface half of the problem. The remaining TOCTOU window is closed by #14964.
Detailed Summary for AI Bots
Problem
is_port_in_useprobed127.0.0.1while the servers under test bind0.0.0.0. CI runners have several interfaces.Change
Probe the unspecified address, so the probe conflicts with exactly what a later bind would.
port_held_on_another_interface_is_reported_in_usebinds a holder on127.0.0.2and fails on the old code. It reports and returns on macOS, which assigns only127.0.0.1to loopback unless an alias was added.