_end() walked the tree under a process it might already have reaped, and
a pid used again by then would have had another program's children
signalled, on a box that runs other work: a server is the process start()
returns now, a wrapper execs it, and only that process is ended. With no
tree walk, a wrapper's child is no longer left running, and a poll reads
the process's own sockets first, the machine's tables only when it has
one. A server that listens on two ports is refused, since which one is
meant cannot be guessed, and one that ends before it listens says what
it wrote on its stderr when start() kept it in a pipe. serve() looked at
every listener of the machine, IPv6-only ones included, which cannot
take an IPv4 port: it reads the IPv4 ones on 127.0.0.1 or any. held()
returns the port alone, the test's cleanup keeping the socket. The
witness that a closed port was anyone's could itself be beaten to it:
the guard's failure on the old tree is the witness.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ci-local.sh runs the six jobs side by side on one machine, and three of
them run the same test files. Eleven files took a port number out of a
socket they then closed, to start a proxy on it or to have a port where
nothing listens. Anyone could be handed that port before the server bound
it: a stranger could then answer in its place, and a dead port could come
alive. run_suite.py ran those files one at a time, which kept them apart
inside the suite job and not from the other jobs (code review,
2026-10-28, never seen in three runs).
tests/localports.py gives three answers. held() keeps a port bound and
never listening: a connection to it is refused and no other program can
bind it. serve() starts a server of the test's process on a held port,
beside the socket that keeps it (SO_REUSEPORT), so an engine that stops
and starts again keeps its port in between. spawn() starts a proxy in a
process of its own and keeps it once the socket listening on its port is
its own, read in /proc, else starts it again on another port. The
certificate test passes port 0, since nobody connects to a proxy that
refuses to start, and now checks that the refusal is the certificate's.
test_localports.py proves each answer on the machine, and fails on a test
file that takes a port the old way: on the tree before this commit it
names the eleven. With none left, the suite runs them four at a time.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without --model it read /v1/models through a curl | python3 pipe inside $(...) under
set -euo pipefail, so a curl that could not connect ended the script with curl's 7 and
nothing on screen, before the line that explains it. It exits 2 with that line now. Its
refusal note also cited a 128000 flash ceiling; the one-prompt ceiling is 250000
(FLASH_PROMPT_CEILING_TOKENS). Found in review, 2026-09-24 (T14).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>