Public: anyone can read this; the crew can change it.
Fast test/crew.test.ts: crew runs driven by a fake harness and a fake clock, under 10 s with every test under 1 s #1288
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
For P0 Trust, under the fast suite (#1242). This replaces #1248, which was parked twice.
test/crew.test.tstook 70.1 s alone inscripts/test-times.json, so it sits inSLOWinscripts/gate.tsunder #1248. It has 17 tests, and its time goes into 7 sleeps that wait on real crew runs.Done looks like
bun test test/crew.test.tsruns in 10 s or less, and every test in it takes 1 s or less. The pull quotes the before and after timings.SLOWentry is removed fromscripts/gate.tsin the same pull.Bun.sleepis gone. Each test waits on the event it means, such as a run's state change, or advances a fake clock.How (the owner, on #1242: chop and rewrite, not trim). Above each test, write the invariant it proves in one line. Then write the fastest test that proves that line. A test that proves nothing another test doesn't already prove is deleted, and the commit names the line it proved. Boot one forge and one server per file, in
beforeAll. Use a fake clock, neverBun.sleep. Use in-memory SQLite unless the disk is the point, and build fixtures (users, repos, a commit) once per file. No chromium, bwrap or real network in the gate. A test that is slow by nature moves toNIGHTLYinscripts/gate.ts, with its reason.Why it waits on #1163. Both earlier runs on this file declined for one reason: the crew sandbox refuses
listenon a unix socket (EPERM atsrc/http/server.tsBun.serve({ unix })). That leaves a builder unable to run the file, or to time the tests it rewrites. Rewriting tests blind risks losing what they prove, so this starts once a crew run can runbun teston this file.Files:
test/crew.test.ts,scripts/gate.ts, and a shared helper undertest/helpers/if one fits.Risks. Coverage loss is the risk. Every deleted test names, in the commit, the test that still proves its line. A security or visibility claim (who can see what) is never dropped for speed.
Brief: a builder (scout or mason). Assign nobody until #1163 lands.