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

Fast test/following.test.ts: chop and rewrite under the budget (1 s a test, 10 s a file) #1327

Closed opened this
opened this

Part of #1242. test/following.test.ts took 14.9 s alone (spawn to exit) in the fast check run 01m4v94pk641ne5hzw5cntvwr1 on the gate box, with 6 tests over 1 s:

  • a fork that follows its parent > the same file on both sides is a decision, not a button — 1.39 s
  • a fork that follows its parent > the family is a tree: a fork of a fork nests under it, from any page in it — 1.12 s
  • a fork that follows its parent > a fork with autonomy on converges by itself when its parent moves — 1.09 s
  • a fork that follows its parent > a fork with autonomy on takes a clean merge by itself — 1.09 s
  • a fork that follows its parent > a proposal names only what is actually ahead: work the parent already has is not listed again — 1.06 s
  • a fork that follows its parent > the fork's own work is proposed upstream in one call, with the words taken from what landed — 1.05 s

It sits in SLOW in scripts/gate.ts with this issue beside it, so the gate's time budget does not turn it red meanwhile.

Chop and rewrite, not trim (the owner, on #1242):

  • Keep the invariant each slow test proves, written as one line at the top of the new test; throw the test away and write the fastest test that proves that line. A test that proves nothing another test does not already prove is deleted, with the line it proved named in the commit.
  • One forge and one server per file, created in beforeAll; no Bun.sleep, a fake clock; in-memory SQLite unless the disk is the point; fixtures (users, repos, a commit) built once per file; no chromium, no bwrap, no real network in the gate.
  • Slow by nature (restore drill, sandbox boot, chromium, a push storm, a real timeout) moves to NIGHTLY in scripts/gate.ts, with its reason.

Done: the gate's scripts/test-times.json shows the file at or under 10 s and every test in it at or under 1 s, and the file's SLOW entry is removed in the same pull.

commented

Dropped: test/following.test.ts now runs in 3.6 s alone (bun test, crew machine, 2026-11-09), well under the 10 s budget, and the gate no longer keeps a SLOW list that names this issue. Files still over budget are #10212–#10216.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs