Files
Miguel Ángel 3bbe78b63c fix(cli): platform-agnostic regression test for port probe race
Strengthens the regression gate from issue #309. The original tests
binding real sockets only caught the bug on Linux (Crostini and likely
Ubuntu), not macOS where wildcard-vs-loopback parallel binds happen
to succeed. That left CI as the only gate and only if the CI runner's
kernel reproduces the race.

testPortOnAllHosts now takes an optional injectable probe. The contract
test passes a recording fake that holds each call for 20ms and tracks
in-flight count. Buggy parallel code drives it to 4; the sequential fix
keeps it at 1. Verified by reverting the fix in place and confirming
the contract test fails with expected=1 / received=4 — then restored
and all 4 tests pass.

Production callers pass no probe and get the real socket check,
unchanged behaviour.
2026-04-18 00:10:24 +02:00
..
2026-04-17 12:15:37 +02:00
2026-04-17 12:15:37 +02:00
2026-04-17 12:15:37 +02:00
2026-04-17 12:15:37 +02:00
2026-04-17 12:15:37 +02:00
2026-04-17 12:15:37 +02:00