test: a server start waits on a deadline, not a try count, in 13 suites (#1714) #1715
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1715
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/1116-1905"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #1714.
server/index.jsneeds 2757-3084 ms to answer/api/versionon an idle host, and 6976-7410 ms when ten start at once - which is exactly whatPF_TEST_CONCURRENCY=10(f6fd08ba, today) asks of the suite. Thirteen suites decided the server was broken by counting attempts:for (i < 60) { try ... break } catch { sleep 100 }waitReady:if (--left <= 0) reject(...)if (i > 150) throw new Error("server did not start")All thirteen pass serially; the four silent ones failed as
ECONNREFUSED 127.0.0.1:6904on the next request, which reads like a missing endpoint rather than a server that was not up yet.Reproduced before, green after
PF_TEST_CONCURRENCY=10 node scripts/run-tests.js:53daa3a4:285 suite(s) in 202.7 s - 10155 assertions passed, 3 failed(board-id-is-a-name, server-compression, server-static-cache), then a second run with 6 failed (the four silent ones plus the twowaitReadyones)285 suite(s) - 10262 assertions passed, 0 failed- twice, consecutively (209.2 s, 202.2 s)The same defect is what made today's legs red on
main:Test (Node 20)at 18:54 on53daa3a4, a docs-only diff, with Node 18 and 22 green on the same sha; all three legs at 11:23 ond8164131;Test (Node 18)at 16:11 on394e1389.What changed
The pattern #1242 established in
test/server-immutable-json.test.js: a wall-clock deadline (60 s) instead of an attempt count, failing withserver did not start within 60000 ms (last error: ECONNREFUSED). Same pass condition, same coverage - a slow start passes, a server that never comes up still fails, and the message says what the last attempt saw.The two
waitReadyfiles take an optionaldeadlineMsand gain one assertion each: a closed port must fail at a 400 ms deadline it is given, so the counting behaviour cannot come back unnoticed (compression 19 -> 20 assertions, static-cache 21 -> 22).Gates
node scripts/syntax-check.js-> Syntax-checked 356 files: all OKnode scripts/audit-port-types.js-> No port contradicts its declared typenode scripts/check-control-bytes.js-> No control bytes in sourcePF_TEST_CONCURRENCY=10, twice -> 285 suites / 10262 assertions / 0 failed41c332df4c0199c730f7