fix(test-curl): keep the socket pass off the environment (#41) #45

Merged
maximus merged 3 commits from issue-41-test-curl-no-proxy into main 2026-10-02 01:25:02 +00:00

3 commits

Author SHA1 Message Date
le king fu
7427577053 test(ci): pin the non-HTTP occupant and the wait deadline of test-curl.sh (#41)
All checks were successful
CI / verification (pull_request) Successful in 27s
CI / verification (push) Successful in 25s
Second review of PR #45, non-blocking: two behaviours were right by hand
and held by no test.

- a listener on 3099 that closes at once, then one that accepts and stalls:
  the port rule is "anything but connection refused", not "an HTTP answer"
- a server that stays alive and never listens: the wait ends on its
  deadline, with a message and exit 1

Also moves the port check above the "Fixtures" comment it had split from
its mkdir lines, and counts four protections in CLAUDE.md, not three.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 21:18:25 -04:00
le king fu
193635a68e fix(test-curl): refuse a port already taken before starting (#41)
All checks were successful
CI / verification (pull_request) Successful in 21s
Review of PR #45: wait_for did not keep a neighbour out. With a listener
already on 3099, the server started by the script only dies of EADDRINUSE
after the wait loop has reached the neighbour, and the cases then ran
against it.

- require_free checks both ports before anything starts: free means
  "connection refused" (curl exit 7), as in scripts/boot-from-copy.sh
- wait_for runs on a clock deadline, and checks the process again after a
  successful probe
- the EXIT trap waits for the servers it killed, so a run started right
  after finds the two ports free

ci.test.js adds a real neighbour on each port, and bounds the two
failed-start cases to 3 s: a message that does not stop the run is now red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 20:51:42 -04:00
le king fu
096f95da05 fix(test-curl): keep the socket pass off the environment (#41)
All checks were successful
CI / verification (pull_request) Successful in 20s
Behind a proxy from the environment, test-curl.sh sent its 18 curl lines to
the proxy instead of the servers it boots: with a dead proxy it exited 7
after 11 s without a line of output.

- export NO_PROXY and no_proxy, as scripts/boot-from-copy.sh does
- unset FORCE_COLOR: node colours a number even into a pipe, and 8 cases
  compared "3" against a coloured "3"
- wait_for checks the server process before the port and stops the run with
  a message when a server died or never answered
- the EXIT trap guards each kill: under set -e, a failed kill on the first
  server ended the trap and left the second one running on 3098

ci.test.js runs the whole script three times: behind a fake proxy that
answers everything, and with a fake node that fails for each port in turn.

Fixes #41

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 20:13:18 -04:00