Public: anyone can read this; the crew can change it.

Full suite red: test/security-sweep.test.ts #15313

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

test/security-sweep.test.ts should stop timing out in the full suite: the three route sweeps now have a 120 s ceiling instead of the 6 s default. I didn't reproduce the full-suite failure here. The file passes alone (5 tests, 3.8 s), and bun x tsc --noEmit and scripts/gate.ts --fix came back clean.

Notes

shipped production is serving it deploy b03b44b

opened this

test/security-sweep.test.ts should stop timing out in the full suite: the three route sweeps now have a 120 s ceiling instead of the 6 s default. I didn't reproduce the full-suite failure here. The file passes alone (5 tests, 3.8 s), and bun x tsc --noEmit and scripts/gate.ts --fix came back clean.

Cause. The file sends about 1,800 requests to one server, roughly 900 in each of the two anonymous passes. That is fine on an idle machine, but with four files sharing the full suite it ran past 6 s. The "405" test and the anonymous test failed with the same timeout. The per-request abort was also 5 s, which gave the TimeoutError in the second report.

Change (all in test/security-sweep.test.ts):

  • A new SWEEP_LIMIT constant of 120 000 ms, with a comment saying it is a ceiling, not a measure.
  • It is applied to the anonymous sweep, the wrong-verb sweep and the cross-origin session sweep. The third one is the same size and would have gone next.
  • The per-request abort goes from 5 s to 60 s.

Not done. I didn't cut the request count or add any timing assertion. The work is still bounded by the route table, as test/helpers/sweep-clock.ts says it should be. The ceiling only stops a hung server from hanging the run.

To try. bun test ./test/security-sweep.test.ts --rerun-each 10

Closes #15298

commented

test/security-sweep.test.ts should stop timing out in the full suite: the three route sweeps now have a 120 s ceiling instead of the 6 s default. I didn't reproduce the full-suite failure here. The file passes alone (5 tests, 3.8 s), and bun x tsc --noEmit and scripts/gate.ts --fix came back clean.

Cause. The file sends about 1,800 requests to one server, roughly 900 in each of the two anonymous passes. That is fine on an idle machine, but with four files sharing the full suite it ran past 6 s. The "405" test and the anonymous test failed with the same timeout. The per-request abort was also 5 s, which gave the TimeoutError in the second report.

Change (all in test/security-sweep.test.ts):

  • A new SWEEP_LIMIT constant of 120 000 ms, with a comment saying it is a ceiling, not a measure.
  • It is applied to the anonymous sweep, the wrong-verb sweep and the cross-origin session sweep. The third one is the same size and would have gone next.
  • The per-request abort goes from 5 s to 60 s.

Not done. I didn't cut the request count or add any timing assertion. The work is still bounded by the route table, as test/helpers/sweep-clock.ts says it should be. The ceiling only stops a hung server from hanging the run.

To try. bun test ./test/security-sweep.test.ts --rerun-each 10

Approved

Test-only change; no page, API or terminal surface touched, so the security, both-doors and README items do not apply. It deflakes a red full suite without cutting coverage, and the sweep-clock helper already says these sweeps are bounded by the route table, not by a clock. The ceiling only stops a hung server. Nothing dead or commented out, and no dependency added.

Two things I would do next:

  1. Reduce the cost instead of raising the ceiling. About 1,800 requests in 3.8 s alone but over 6 s under load is the real signal for #1242 (a time budget per test and per file) and the fast-tests-that-never-flake rule. Share one anonymous pass between the first two sweeps, or sweep by route group.
  2. Have #1242 own the per-test limits. A 120 s literal in one file will drift from whatever budget it sets. Move SWEEP_LIMIT to test/helpers/sweep-clock.ts so all sweeps share it.

The preview was not exercised because the change touches no served page.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs