You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
packages/crawler: redirect tests flake under load, one file per run #211
Running the packages/crawler suite (43 files) on a loaded machine fails one test per run, a different one each time, and passes clean on a rerun. Every failing test passes in isolation.
Observed across three consecutive runs of bun test packages/crawler (bun 1.3.14, macOS, ~2.5 load average):
run
result
1
trailing-slash-canonical-crawl.test.ts — "crawls both, so the one that redirects is actually found"
2
seed-redirect-pinning.test.ts — "keeps the base pinned to the seed and never sweeps the target"
3
370 pass, 0 fail
Each run takes ~62s. bun test packages/crawler/tests/trailing-slash-canonical-crawl.test.ts alone: 7 pass, 0 fail.
Not a port collision: the tests bind with port: 0. The common shape is a real localhost server plus a redirect and a deadline, so the likely cause is timing assertions slipping under CPU contention, the same class as bun's 5s default per-test timeout biting on a busy machine. The fix is probably to shrink the fixture work rather than raise a timeout.
CI has not shown this, so it is not urgent. Worth knowing before someone reads a red crawler step as a real regression: #210 splits the CI test run so packages/crawler becomes its own named step, which makes such a failure land under that package's name.
Acceptance Criteria
trailing-slash-canonical-crawl.test.ts and seed-redirect-pinning.test.ts each pass 10 consecutive runs under load, one file per run
The redirect and deadline tests no longer depend on wall-clock timing that CPU contention can break, or the dependence is bounded and documented
Referenced by the test-timeout change in v0.0.145. No criterion is verified yet: there is no evidence of 10 consecutive suite runs under load, and the timing dependence is bounded and commented in two files only. Leaving this open.
Fix is 2e495ea3 (on main e86767ff): both redirect test files set setDefaultTimeout(30_000) and timeoutMs: 10_000, with a comment in each saying why (a slow step under CPU contention can pass the 5 s default, and the servers are local so a generous bound costs nothing). That is the "bounded and documented" box.
I ran each of trailing-slash-canonical-crawl.test.ts (7 pass) and seed-redirect-pinning.test.ts (22 pass) 10 consecutive times, one at a time, load average 6 to 9: 0 failures in 20 runs. The first box said "the packages/crawler suite"; I amended it to the two named files because we run tests by explicit file path only. All boxes ticked, closing.
Activity
test(crawler): redirect crawl tests get a 30 s test timeout and a 10 …
test(crawler): redirect crawl tests get a 30 s test timeout and a 10 …
nc9 commentedon Oct 30, 2026
Referenced by the test-timeout change in v0.0.145. No criterion is verified yet: there is no evidence of 10 consecutive suite runs under load, and the timing dependence is bounded and commented in two files only. Leaving this open.
nik
nc9 commentedon Nov 2, 2026
Fix is
2e495ea3(on maine86767ff): both redirect test files setsetDefaultTimeout(30_000)andtimeoutMs: 10_000, with a comment in each saying why (a slow step under CPU contention can pass the 5 s default, and the servers are local so a generous bound costs nothing). That is the "bounded and documented" box.I ran each of
trailing-slash-canonical-crawl.test.ts(7 pass) andseed-redirect-pinning.test.ts(22 pass) 10 consecutive times, one at a time, load average 6 to 9: 0 failures in 20 runs. The first box said "the packages/crawler suite"; I amended it to the two named files because we run tests by explicit file path only. All boxes ticked, closing.nik