Two SDK tests fail intermittently on Linux CI (linux-x64-artifact, the full vitest run) and now routinely cost a rerun of main and PR builds, including the v2.0.41 release (main 345d87f, run 37196319563: attempt 1 failed on (A), attempt 2 on (B)).
(A) tests/authored-parallel-agents.test.ts › "authored steps under local workers with capacity > never starts queued agents once the body has failed"
Error: ENOENT: no such file or directory, open '/tmp/flows-chain-XXXX/spans.jsonl'. Also failed on main run 37137600293 and on #608's PR head. Likely the test reads spans.jsonl before the writer has created/flushed it (or after a cleanup races it): a timing assumption, not a product bug, unless the product promises the file exists by then. Find which and fix the right side.
(B) tests/named-gate-diagnostics.test.ts › "word_count_bounds reports why its own child failed > reports output that is not a count"
expected 'word_count_bounds: could not run wc -…' to contain 'not a number'. Also failed on main run 37103010381 and on #610. The test writes a stub wc (stubWordCount: writeFileSync + chmodSync) and immediately executes it via PATH. Strong hypothesis: Linux ETXTBSY ("Text file busy"): a concurrent fork elsewhere in the vitest process inherits the still-open write fd, so exec of the just-written file fails. Confirm from the full error (print the errno/code), then fix robustly, e.g. retry the spawn on ETXTBSY in the gate's child launcher (the product can hit this too) and/or create stub executables in a way that cannot leave a writable fd open across a fork (write in a child process, or copy a prebuilt fixture). Apply to every test helper that writes-then-executes.
Acceptance: for each, a deterministic reproduction or a stress loop (e.g. vitest run <file> --repeat / many iterations under parallel load) that fails before and passes after; no blanket retries of whole tests.
Two SDK tests fail intermittently on Linux CI (
linux-x64-artifact, the fullvitest run) and now routinely cost a rerun of main and PR builds, including the v2.0.41 release (main 345d87f, run 37196319563: attempt 1 failed on (A), attempt 2 on (B)).(A)
tests/authored-parallel-agents.test.ts› "authored steps under local workers with capacity > never starts queued agents once the body has failed"Error: ENOENT: no such file or directory, open '/tmp/flows-chain-XXXX/spans.jsonl'. Also failed on main run 37137600293 and on #608's PR head. Likely the test readsspans.jsonlbefore the writer has created/flushed it (or after a cleanup races it): a timing assumption, not a product bug, unless the product promises the file exists by then. Find which and fix the right side.(B)
tests/named-gate-diagnostics.test.ts› "word_count_bounds reports why its own child failed > reports output that is not a count"expected 'word_count_bounds: could not run wc -…' to contain 'not a number'. Also failed on main run 37103010381 and on #610. The test writes a stubwc(stubWordCount: writeFileSync + chmodSync) and immediately executes it via PATH. Strong hypothesis: Linux ETXTBSY ("Text file busy"): a concurrent fork elsewhere in the vitest process inherits the still-open write fd, so exec of the just-written file fails. Confirm from the full error (print the errno/code), then fix robustly, e.g. retry the spawn on ETXTBSY in the gate's child launcher (the product can hit this too) and/or create stub executables in a way that cannot leave a writable fd open across a fork (write in a child process, or copy a prebuilt fixture). Apply to every test helper that writes-then-executes.Acceptance: for each, a deterministic reproduction or a stress loop (e.g.
vitest run <file> --repeat/ many iterations under parallel load) that fails before and passes after; no blanket retries of whole tests.