Thirteen test suites give up on a server start after a fixed number of tries, so a 10-way CI leg goes red on a slow start #1714
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1714
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
The measurement
server/index.jsneeds time to answer/api/version: 2757, 2955, 3084, 2980, 2952 ms over five starts on an idle host. Start ten at once - which is whatPF_TEST_CONCURRENCY=10does, the value.forgejo/workflows/ci.ymltook today inf6fd08ba- and every one of them takes 6976-7410 ms.Thirteen suites decide the server is broken by counting attempts rather than by how much time has passed:
for (let i = 0; i < 60; i++) { try ... break } catch { sleep 100 }waitReady:let left = 60; if (--left <= 0) reject('server did not start')if (i > 150) throw new Error('server did not start')So a loaded host turns a slow start into a red leg, and the four silent ones fail as
ECONNREFUSED 127.0.0.1:6904on the next request, which reads like a missing endpoint rather than a server that was not up.Reproduced
PF_TEST_CONCURRENCY=10 node scripts/run-tests.jsonorigin/main@53daa3a4:285 suite(s) in 202.7 s - 10155 assertions passed, 3 failed- board-id-is-a-name, server-compression, server-static-cache285 suite(s) in ... s - 6 failed- link-instant, ping-count, ping-instant, ping-surface, server-compression, server-static-cacheAll thirteen pass individually, serially. The red legs on
maintoday are the same defect seen from the outside:Test (Node 20)at 18:54 on53daa3a4, which is 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.The fix
The pattern #1242 already established in
test/server-immutable-json.test.js: a wall-clock deadline (60 s) instead of an attempt count, and a failure that names what the last attempt saw -server did not start within 60000 ms (last error: ECONNREFUSED). Applied to the thirteen suites above, same pass condition, same coverage, and the twowaitReadyfiles gain an assertion that a closed port still fails at the deadline it was given (400 ms) so the counting behaviour cannot come back unnoticed.Filed from a worker run; the pull request follows.