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

test/checks.test.ts runs in under 10 s, split where it covers more than one concept #10878

Merged opened this

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

Merged

I split `test/checks.test.ts` (1477 lines, 26.3 s on the check) into four files, one concept each. All 45 tests are kept under their original names, and all 152 `expect(` sites are still there. No test was dropped.

shipped production is serving it deploy da127e7

opened this

I split test/checks.test.ts (1477 lines, 26.3 s on the check) into four files, one concept each. All 45 tests are kept under their original names, and all 152 expect( sites are still there. No test was dropped.

FileWhat it coversTestsLocal run
test/checks.test.tsWhat asks for a check (push, pull, approval of a fork pull, re-request) and what the verdict says (summary, log, FORGE_CELLS, wrong declaration, shard events)102.7 s
test/checks-queue.test.tsThe lane: a newer commit supersedes a waiting check, a new head stops the old head's, merge/close and cancelRunsForPull, holdsLastSlot, pickNext, a freed slot takes the newest102.3 s
test/checks-restart.test.tsThe service's stops and boots: queued again on stop, drain on a roll, a person's stop, boot checks an unchecked pull, requeueAbandonedChecks, the boot sweep of checkouts91.9 s
test/checks-failure-summary.test.tsThe pure parsers parseBunTestFailure and summariseCheckFailure, including the sharded gate's log160.2 s

The shared setup and polling helpers moved into test/helpers/checks-forge.ts: the live forge with its one check slot, alice, bob and lib, plus settled, until, held/release, headAnnounced, checksOf and slowCheck. Each file now boots its own forge, so the files no longer depend on each other's order.

What to look at:

  • The OK.md seed: the helper commits OK.md (and no forge.json) to main when it boots. The moved queue and restart tests used to get that file from an earlier test in the same file, and failed without it. Because there is no forge.json, the seed asks for no check, so "a commit that declares no check is not checked" still sees exactly one check run.
  • Recorded times: scripts/test-times.json now carries the times measured locally, as earlier split pulls did. I could not run the forge's check here, so the under-10 s and under-1 s-per-test criteria are not confirmed on the check yet. Its first run on this push is the real figure. The slowest single test locally was about 0.5 s. All four files passed three rounds run side by side.

Checks run:

  • bun scripts/gate.ts passes and picks up the new files with no list to edit.
  • bun x tsc --noEmit is clean.
  • The 21 test files scripts/fast.ts named, plus check-list, rule-tests-always and check-tiers: 322 pass, 0 fail.
  • test/check-list.test.ts is one of those tests, and it passes.

I did not have the keep_plan tool in this run, so no plan was posted on the issue.

To try it: bun test test/checks.test.ts test/checks-queue.test.ts test/checks-restart.test.ts test/checks-failure-summary.test.ts

🤖 Generated with Claude Code

Closes #10866

commented

I split test/checks.test.ts (1477 lines, 26.3 s on the check) into four files, one concept each. All 45 tests are kept under their original names, and all 152 expect( sites are still there. No test was dropped.

FileWhat it coversTestsLocal run
test/checks.test.tsWhat asks for a check (push, pull, approval of a fork pull, re-request) and what the verdict says (summary, log, FORGE_CELLS, wrong declaration, shard events)102.7 s
test/checks-queue.test.tsThe lane: a newer commit supersedes a waiting check, a new head stops the old head's, merge/close and cancelRunsForPull, holdsLastSlot, pickNext, a freed slot takes the newest102.3 s
test/checks-restart.test.tsThe service's stops and boots: queued again on stop, drain on a roll, a person's stop, boot checks an unchecked pull, requeueAbandonedChecks, the boot sweep of checkouts91.9 s
test/checks-failure-summary.test.tsThe pure parsers parseBunTestFailure and summariseCheckFailure, including the sharded gate's log160.2 s

The shared setup and polling helpers moved into test/helpers/checks-forge.ts: the live forge with its one check slot, alice, bob and lib, plus settled, until, held/release, headAnnounced, checksOf and slowCheck. Each file now boots its own forge, so the files no longer depend on each other's order.

What to look at:

  • The OK.md seed: the helper commits OK.md (and no forge.json) to main when it boots. The moved queue and restart tests used to get that file from an earlier test in the same file, and failed without it. Because there is no forge.json, the seed asks for no check, so "a commit that declares no check is not checked" still sees exactly one check run.
  • Recorded times: scripts/test-times.json now carries the times measured locally, as earlier split pulls did. I could not run the forge's check here, so the under-10 s and under-1 s-per-test criteria are not confirmed on the check yet. Its first run on this push is the real figure. The slowest single test locally was about 0.5 s. All four files passed three rounds run side by side.

Checks run:

  • bun scripts/gate.ts passes and picks up the new files with no list to edit.
  • bun x tsc --noEmit is clean.
  • The 21 test files scripts/fast.ts named, plus check-list, rule-tests-always and check-tiers: 322 pass, 0 fail.
  • test/check-list.test.ts is one of those tests, and it passes.

I did not have the keep_plan tool in this run, so no plan was posted on the issue.

To try it: bun test test/checks.test.ts test/checks-queue.test.ts test/checks-restart.test.ts test/checks-failure-summary.test.ts

🤖 Generated with Claude Code

Approved

A pure test split along concept lines, with no behaviour change. The preview is unaffected. The part of the diff I could read shows every moved test kept under its name, and a shared helper in test/helpers/checks-forge.ts so each file boots its own forge. gate.ts passes. My clone is at the base, so I could not run the four new files here. The under-10 s and under-1 s figures rest on the builder's local numbers (2.7, 2.3, 1.9, 0.2 s); the first check on this push is the real measure. Two things I would do next: (1) read the check log and replace the locally measured entries in scripts/test-times.json with the check's own figures, since the other split pulls did; (2) pass the OK.md seed into checksForge as an option, so the hidden seed in the helper is visible at each call site.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs