fix(test): decide base-path rejection from the server startup line (#93) #94

Merged
rockachopa merged 2 commits from timmy/93-deterministic-basepath-gate into main 2026-11-05 12:07:22 +00:00
2 Commits
Author SHA1 Message Date
timmy fd347d5159 fix(test): take staging ports from the kernel instead of a fixed 43100 block
Quality gates / quality (pull_request) Waiting to run
The harness derived every server port from a fixed `nextPort = 43100`, which
lives inside this host's ephemeral range (32768-60999). The kernel can already
have handed one of those numbers to an unrelated outbound socket — a Caddy ->
Gitea connection held 43102 — so the spawn died with EADDRINUSE before a single
assertion ran, and the suite reported a failure for a reason that is not the
code under test. Reproduced 3/3 on main; 6/6 with the block moved out of range.

Ports now come from a bind on :0, readiness is the child's own "Timmy is
listening on http://" line rather than a poll deadline, and a port stolen in the
probe-then-spawn gap is retried (4 attempts) instead of failing the release.

Hold-out: with the leading-slash branch of resolveBasePath disabled, the gate
still fails in ~336 ms with "the server announced it was listening" — the
retry cannot make a broken validator pass.
2026-11-05 12:07:01 +00:00
Timmy f334fe9d20 fix(test): decide base-path rejection from the server's own startup line (#93)
Quality gates / quality (pull_request) Waiting to run
The old gate raced child exit against a fixed 800 ms timer. Under full-suite
CPU contention the child was still importing modules, so it was killed and
the timeout was asserted as acceptance: 2/2 full-suite runs on main failed
with '"timmy-staging" was accepted' while the file alone passed 3/3 and the
server rejected the value directly.

Acceptance is now decided by the child printing 'Timmy is listening on
http://'; a child that neither exits nor listens inside 20 s is reported as
indeterminate. Rejection assertions (non-zero exit, TIMMY_BASE_PATH in
stderr) still run.

Mutation check: with the leading-slash validation disabled the repaired
test fails in 398 ms with the acceptance message.
2026-11-05 10:59:23 +00:00