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

Full suite red: test/load-bench.test.ts #12665

Merged opened this in answer to

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

Merged

Two tests in test/load-bench.test.ts were over the 2 s budget, and both now run for under a second of measured load. I did not run the full suite; the forge runs it on the push.

Notes

shipped production is serving it deploy 5bb6da3

opened this

Two tests in test/load-bench.test.ts were over the 2 s budget, and both now run for under a second of measured load. I did not run the full suite; the forge runs it on the push.

Cause: the --compare test and the --bypass test each start bench/load.ts and drive it for a full second, --bypass with a second of warm-up as well. Bun start-up and the flood alone came to about 2.05 s.

Change (test file only):

  • The --compare runs now use --seconds 0.4.
  • The --bypass run now uses --seconds 0.5 --warm 0.5. bench/load.ts already accepts fractional seconds, so the bench itself is unchanged.
  • The assertions are unchanged. Both tests still check the same things:

- --compare exits 1 on a fall of more than 20% and 0 when the rate held. - --bypass sends the cookie on every request, --warm requests are not counted, and the result names its kind. - The target-missed message still reads "asked 40/s, 460/s under the 500/s target".

I did not add the file to SLOW in scripts/gate.ts; making the tests faster was enough.

Checks: bun test ./test/load-bench.test.ts --rerun-each 5 passed 15 of 15 here. bun x tsc --noEmit and bun scripts/gate.ts printed nothing.

To try: bun test ./test/load-bench.test.ts --rerun-each 10

Closes #12645

commented

Two tests in test/load-bench.test.ts were over the 2 s budget, and both now run for under a second of measured load. I did not run the full suite; the forge runs it on the push.

Cause: the --compare test and the --bypass test each start bench/load.ts and drive it for a full second, --bypass with a second of warm-up as well. Bun start-up and the flood alone came to about 2.05 s.

Change (test file only):

  • The --compare runs now use --seconds 0.4.
  • The --bypass run now uses --seconds 0.5 --warm 0.5. bench/load.ts already accepts fractional seconds, so the bench itself is unchanged.
  • The assertions are unchanged. Both tests still check the same things:

- --compare exits 1 on a fall of more than 20% and 0 when the rate held. - --bypass sends the cookie on every request, --warm requests are not counted, and the result names its kind. - The target-missed message still reads "asked 40/s, 460/s under the 500/s target".

I did not add the file to SLOW in scripts/gate.ts; making the tests faster was enough.

Checks: bun test ./test/load-bench.test.ts --rerun-each 5 passed 15 of 15 here. bun x tsc --noEmit and bun scripts/gate.ts printed nothing.

To try: bun test ./test/load-bench.test.ts --rerun-each 10

Approved

Clean. Test-only change that shortens the load durations in two tests (bench/load.ts already takes fractional --seconds/--warm). The assertions are unchanged, and the compare cases use huge margins (100000 vs 10), so fewer samples will not make them flaky. No security, dependency or doc surface is touched. It fits the pipeline direction on test time budgets.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs