Found by the gate on #368 (issues #348/#352), out of scope for that PR and filed rather than fixed there.
worker/test/start-wiring.test.mjs:1923, "a real err.reason token rides the hook's argv end to end, through a REAL
script (review finding)", polls for a genuinely spawned sh child to append a file:
for (let i = 0; i < 100 && !existsSync(out); i++) await new Promise((r) => setTimeout(r, 20));
assert.ok(existsSync(out), "the hook really spawned");
That is a 2 s budget. Under the full parallel suite it can be missed: an executing reviewer saw it fail once in two
full CI-posture runs on an otherwise clean tree, and pass 3/3 in isolation (91/91 for the file). The assertion that
fails is the hook really spawned, which reads like a real defect in the failure hook and is not one.
This matters more than an ordinary flake because the suite runs in a REQUIRED check (contract-tests runs it three
times per job: plain, under test-count-check.mjs, and on a clock shifted 399 days). A one-in-N failure there is a
red build on a tree nobody touched, which is the shape issue #284 already cost this project a day of merges to.
Suggested fix, and it costs nothing on the happy path because the loop exits on first existence: raise the bound
(for example i < 500, a 10 s ceiling). Worth checking whether any sibling in the file polls a real child on the
same 2 s budget and raising those together rather than one at a time.
Not a product defect: nothing about the hook, its argv or its env threading is in question, and the test proves
what it says it proves when it is given time to.
Found by the gate on #368 (issues #348/#352), out of scope for that PR and filed rather than fixed there.
worker/test/start-wiring.test.mjs:1923, "a real err.reason token rides the hook's argv end to end, through a REALscript (review finding)", polls for a genuinely spawned
shchild to append a file:That is a 2 s budget. Under the full parallel suite it can be missed: an executing reviewer saw it fail once in two
full CI-posture runs on an otherwise clean tree, and pass 3/3 in isolation (91/91 for the file). The assertion that
fails is
the hook really spawned, which reads like a real defect in the failure hook and is not one.This matters more than an ordinary flake because the suite runs in a REQUIRED check (
contract-testsruns it threetimes per job: plain, under
test-count-check.mjs, and on a clock shifted 399 days). A one-in-N failure there is ared build on a tree nobody touched, which is the shape issue #284 already cost this project a day of merges to.
Suggested fix, and it costs nothing on the happy path because the loop exits on first existence: raise the bound
(for example
i < 500, a 10 s ceiling). Worth checking whether any sibling in the file polls a real child on thesame 2 s budget and raising those together rather than one at a time.
Not a product defect: nothing about the hook, its argv or its env threading is in question, and the test proves
what it says it proves when it is given time to.