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
test: per-host throttle sequential spacing assertion is load-sensitive (27 ms against a 30 ms bound) #1516
Found while reviewing #1319 (CI run of that PR). Not caused by that PR: it touches no apps/cli files.
apps/cli/tests/crawler/per-host-throttle.test.ts (around line 466), the test "per-host throttle (#265) > sequential mode (perHostConcurrency=1) still spaces starts by the delay", asserts that the spacing between starts is at least 0.6 times the delay (30 ms). Under CI load it measured 27 ms ("Expected: >= 30, Received: 27") and failed the CLI tests job. Run by path twice at low load on the parent tree it passes 6 of 6.
Acceptance Criteria
The sequential-mode spacing assertion no longer depends on wall-clock timing under load: it uses a fake clock, or a tolerance that a loaded runner cannot miss (for example the median spacing, or a lower bound with a documented margin)
The test still fails if the per-host delay is removed (checked by mutating the delay to 0)
The file passes 10 of 10 consecutive runs with 12 busy processes running alongside
No other timing assertion in the same file asserts a bound within 2x of the measured spacing
I would like to take this. I will first reproduce the sequential-spacing test under load and verify that setting the delay to zero makes the current assertion fail, then replace the wall-clock-sensitive bound with the smallest documented assertion that preserves that mutation check. I will also audit the other timing bounds in this file and run the requested 10 loaded repetitions.
Checked against v0.0.158. All four criteria are met: the sequential spacing assertion uses the median gap and the total span with lower bounds at 0.4 of the delay (no wall-clock bound a loaded runner can miss); the tests still fail when the per-host spacing is removed from the crawler source (mutated in review: four of the six tests go red), and when the Crawl-delay cap is removed; the file passed 10 of 10 consecutive runs with 12 busy processes running alongside (6 of 6 tests each); and the other lower bounds also moved to 0.4 with the capped-delay upper bound at 5,000 against the declared 10,000. One tolerance note: the bounds accept a spacing down to about 0.4 of the configured delay, so halving the delay is not caught. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.158
Activity
style(cli): oxfmt the per-host throttle test #1516
WilliamK112 commentedon Nov 1, 2026
I would like to take this. I will first reproduce the sequential-spacing test under load and verify that setting the delay to zero makes the current assertion fail, then replace the wall-clock-sensitive bound with the smallest documented assertion that preserves that mutation check. I will also audit the other timing bounds in this file and run the requested 10 loaded repetitions.
test(crawler): stabilize throttle spacing checks squirrelscan#1516
test(crawler): assert total throttle span squirrelscan#1516
test(crawler): stabilize throttle spacing checks #1516
test(crawler): assert total throttle span #1516
nc9 commentedon Nov 1, 2026
Fixed in v0.0.158 by William's #1519 (commits
d2007730,f4a8e937): the sequential spacing checks now use lower bounds at 0.4 of the delay, the median gap and the total span first to last, and the test passed 6 of 6 and 5 of 5 under 3 busy processes in review; removing the per-host spacing in the crawler source turns it red. Thank you William. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.158nik
nc9 commentedon Nov 1, 2026
Checked against v0.0.158. All four criteria are met: the sequential spacing assertion uses the median gap and the total span with lower bounds at 0.4 of the delay (no wall-clock bound a loaded runner can miss); the tests still fail when the per-host spacing is removed from the crawler source (mutated in review: four of the six tests go red), and when the Crawl-delay cap is removed; the file passed 10 of 10 consecutive runs with 12 busy processes running alongside (6 of 6 tests each); and the other lower bounds also moved to 0.4 with the capped-delay upper bound at 5,000 against the declared 10,000. One tolerance note: the bounds accept a spacing down to about 0.4 of the configured delay, so halving the delay is not caught. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.158
nik