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
tests: integrity-budget-784 fails under load (wall-clock rule time budget); make it clock-independent #1465
packages/rules/tests/integrity-budget-784.test.ts is load-sensitive. It runs the integrity rules through RuleRunner on hostile pages (5 MB of controls, 100 KB of nested templates, 500 KB aria-labelledby, 300 U+FDFA labels, the #1424 label-window budgets) and asserts each rule finished: no -error or timeout check and no skipped check. The runner enforces a wall-clock per-page rule time budget ([rules] time_budget_ms, RunnerOptions.ruleTimeBudgetMs), so on a loaded machine the same test that passes on an idle one is cut by the clock and fails.
Observed: 27 of 27 pass on an idle machine; with load averages of 11 to 13, 6 of 27 failed in one run (two of them budget tests added for #1424), and on some runs the file exits without printing a summary. The tests are about work bounds (how much of the page the rule reads), not about elapsed time.
Acceptance Criteria
Tests whose subject is a work bound or a cap do not depend on wall-clock time: they run the runner with the per-page time budget raised or turned off (time_budget_ms), or with an injectable clock
Any test whose subject is the wall-clock budget itself uses an injectable clock instead of real elapsed time
bun test ./tests/integrity-budget-784.test.ts passes 27 of 27 ten times in a row while the machine is under artificial CPU load (for example 12 busy processes)
The file prints its summary on every run (no silent exit)
Activity
test(rules): integrity budget tests run with the rule clock off and i…
test(rules): pin the integrity window budgets, per-control cap and vi…
test(rules): integrity budget tests run with the rule clock off and i…
test(rules): pin the integrity window budgets, per-control cap and vi…
nc9 commentedon Nov 1, 2026
Shipped in v0.0.154, checked against main. Criteria 1, 3 and 4 are met. Criterion 2 is met only vacuously: no test in the rules package exercises the clock budget and none uses an injectable clock, so it cannot regress visibly. Closing; a follow-up can add a clock-budget test if wanted. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.154
nik