Files
pad/internal
xarmian c3d64451ed test(buildtools): the install-refresh pre-server proves it is the listener the script probes (TASK-3146) (#1443)
* test(buildtools): the install-refresh pre-server proves it is the listener the script probes (TASK-3146)

Seven tests pre-start a "running server" on a port chosen by freePort, which
releases the port before the stub binds it, and then waited only until
SOMETHING answered on it. A stub that lost the port in that window exits on
the bind error and the dial succeeds against the foreign listener, so the
script's outcome was judged against someone else's process.

The port cannot be 0 there, as it is in BUG-3144's two-server test, because
the script restarts that server and reads the port from PAD_PORT or the
captured argv. startPreServer therefore proves two things instead: the
stub's own STUB_ANNOUNCE line, with the port it bound equal to the chosen
one, and its pid at the address the script will probe (a new /stub/pid
route), which covers a wildcard bind beside a held specific address on a
stack that permits it. A collision is now a named fixture failure.

Tests force each case: a foreign listener answering health ok on the
chosen port, a probe address that reaches someone else, and a stub that
bound a different port, plus a positive control.

Claude-Session: https://claude.ai/code/session_01Vf8uZmYdsrQqJtbAmjUFSX

* test(buildtools): hold the chosen port in the port-proof case so the stub's port 0 cannot land on it (TASK-3146, codex round 1)

Claude-Session: https://claude.ai/code/session_01Vf8uZmYdsrQqJtbAmjUFSX
2026-09-22 19:55:00 -04:00
..
2026-03-26 01:52:36 +00:00