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

Full suite red: test/flow-cache.test.ts #12750

Merged opened this in answer to

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

Merged

test/flow-cache.test.ts now builds a thirtieth of production's data instead of a tenth, which halves its run time here. The change is one commit and touches only the test's data size. What was slow: the time went into building the large fixture in beforeAll.

Notes

shipped production is serving it deploy dd33527

opened this

test/flow-cache.test.ts now builds a thirtieth of production's data instead of a tenth, which halves its run time here. The change is one commit and touches only the test's data size.

  • What was slow: the time went into building the large fixture in beforeAll. Alone here the file took 3.9 s, so the 37 s in the full suite was most likely load from four files running at once, not the file itself.
  • Result: the file now runs in 1.9 s alone. All 9 tests pass with the same 84 expect() calls, and the slice test (at least 8 slices) still passes. I did not reproduce the 4-at-a-time load, so I haven't confirmed it stays under the 20 s budget there.
  • Checks: bun scripts/gate.ts and bun x tsc --noEmit ran clean. I ran only this test file.
  • Left alone: I did not add the file to SLOW in scripts/gate.ts, since the fixture was the cost and shrinking it fixes that. The other bigForge users (boot-no-stall, search-production-size, job-slices) are untouched.

To try it: bun test ./test/flow-cache.test.ts.

Closes #12736

Approved

Test-only change: the big-forge fixture shrinks from a tenth to a thirtieth of production, rounded up with Math.ceil so no table ends up empty or fractional. The shape-based assertions (cache hit, single queued refresh, stale-while-revalidate, etag, 304) do not depend on row counts, so the tests still fail without the behaviour. Nothing in src/web or the docs is touched, so the preview shows no change. Two things I would do next: (1) have the TENTH-to-SMALL rename reference the scale in one named constant (const SCALE = 30) so the comment and the divisor cannot drift; (2) update the #12643 comment, since its 23 s figure was measured at full size and should now say what the thirtieth costs.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs