Files
alzeo/tests
Hasan BasbunarandClaude Opus 5.5 8bb32a2d17 tests: the port a test starts a server on stays its own beside the other jobs
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>
2026-10-30 11:51:55 +01:00
..
2026-10-23 06:32:38 +02:00