Repository navigation
Description
On a local 18-core Mac, just check on main (9f099d4) fails only on the 5s unit-test budget (test/unit-test-budget.setup.ts, #2817). There are no assertion failures: with CHANT_UNIT_TEST_BUDGET_MS=30000 the same run passes (28,999 passed, 147 skipped). CI passes because its runner keeps these under 5s.
Which tests, and how many, varies with load: 26 in a full just check, 40 in npx vitest run --project unit packages/core. They are the tests that drive real git repos, bare remotes and signing, in packages/core/src/workspace/ (ci-green*, ci-serve, ci-run*, runs*, lineage-, status-, work-history, check-contract, graph-contract, records-sessions-write), lifecycle/ (release-*, publish-resume, work-lease) and op/ (operator, work-lease-run). The same tests went over budget on the pre-epic main (8cd7346) in a side-by-side run during #4419.
Also seen independently during the multi-engine epic-ready (#4450): paired runs on main and the integration branch flipped between 0 and 11 over-budget tests with machine load alone, no assertion failures. That report (#4469) was closed as a duplicate of this one.
The budget is one number for every unit test today: unitTestBudgetMs(process.env) in test/unit-test-budget.ts, read by the setup file, with no per-file override.
Choices:
- move these to
*.e2e.test.ts, as the budget message suggests (they then stop running on pull requests); - give these files their own higher budget;
- make them faster (shared repo fixtures, fewer git subprocesses).
Found during #4419's end-of-epic test pass.
Acceptance
- (maintainer run)
just checkon main on the 18-core Mac passes with the default 5s budget two runs out of two, andnpx vitest run --project unit packages/corereports no over-budget test. - CI's unit shards still pass with the default budget, and the listed files still run on pull requests (unless the ruling below moves them to e2e, in which case they appear in the e2e project's run in
release-suites.yml). - If a per-file budget is added: a test in
test/asserts that a listed file gets its higher budget and every other file keeps 5s, and the budget message names the file's budget.
Open questions
- How should the slow git and signing tests in packages/core stop failing the 5s unit budget locally?
- (a) Move them to
*.e2e.test.ts. Localjust checkpasses, but they stop running on pull requests and only gate the release. - (b) Give these files a higher per-file budget (for example 15s). They keep running on PRs; needs a small per-file mechanism in the budget setup.
- (c) Make them faster with shared repo fixtures and fewer git subprocesses. Keeps the 5s bar, but it is open-ended work across ~40 tests.
- Recommended: (b) now, then (c) file by file, because these tests cover code every PR touches, so dropping them from PRs (a) costs more than a looser budget on a named list.
- (a) Move them to
Activity
lex00 commentedon Oct 26, 2026
Also seen independently during the multi-engine epic-ready (#4450): paired runs on main and the integration branch flipped between 0 and 11 over-budget tests with machine load alone, no assertion failures. That report (#4469) is closed as a duplicate of this one.
lex00 commentedon Oct 26, 2026
Maintainer rulings on this issue's open questions (2026-10-25, epic:engine-ship refinement):
Ruling: Per-file budget
test: define repoRoot in the budget setup (#4472)
lex00 commentedon Oct 26, 2026
Merged into integration/engine-ship at f6aa69f (unit branch unit/es-chant-4472), following the ruling (per-file budget).
What landed:
SLOW_FILE_BUDGET_MS(15s) andSLOW_UNIT_TEST_FILES, the issue's file set spelled out as 46 repo-relative paths (packages/core/src/workspace: ci-green*, ci-serve*, ci-run* including ci-runner-key and ci-runner-start, runs*, lineage-, status-, work-history, check-contract, graph-contract, records-sessions-write; lifecycle: release-*, publish-resume, work-lease; op: operator, work-lease-run). The list is explicit names, not patterns, so a new file never joins it by accident.unitTestBudgetForFile(file, runBudget)gives a listed file max(15s, run budget), every other file the run budget, and 0 still turns every budget off.overBudgetMessagetakes the file and, for a listed one, names the file and its budget.ctx.task.file.filepath, relative to the repo root, and applies that file's budget.The listed files stay in the unit project, so they still run on pull requests. Checked: tsc over the three test/ files is clean.
Still missing: (maintainer run)
just checktwice on the 18-core Mac andnpx vitest run --project unit packages/corewith no over-budget test; CI unit shards with the default budget. Option (c), making these files faster and taking them off the list one by one, is left for later.lex00 commentedon Oct 26, 2026
Ticked the per-file budget item: unit-test-budget.test.ts (merge f6aa69f) passed in the epic-ready unit runs; chant main e17daa8.
Budget finding from epic-ready, for the maintainer's runs to decide. Three full
npx vitest run --project unitruns on this Mac:Run alone, both files passed 3 of 3. pr-waves-blocked.test.ts takes the same time alone on main and on the integration tip (file 5.38s vs 5.24s), so it is load and not a regression. Neither file is in the named slow list, and neither drives git or signing.
Left: (maintainer run)
just checkon main twice with the default budget, andnpx vitest run --project unit packages/corewith no over-budget test; then CI's unit shards on main.lex00 commentedon Oct 26, 2026
Main is now 1b233ff (tree equal to tested tip 991ca77; unit suite 29255 passed). The steps above still hold; the only change since e17daa8 is #4475's drift-record files.
lex00 commentedon Oct 26, 2026
epic-ready (round 2, F1), per the #4502 ruling: packages/core/src/workspace/intent-gaps.test.ts is added to SLOW_UNIT_TEST_FILES in test/unit-test-budget.ts (#4472's per-file budget list, 15s per test), with the reason in a comment: it walks real git history per test and is load-sensitive.
Orchestrator's measurement, the file alone, three runs on 556c71d: wall 5.4s, 14.9s, 16.9s (target 2.5s alone); slowest test 1.8s, 4.7s, 5.9s; run 3 failed the 5s budget on "the warning follows the revision read: under --at c1 ...", and that flips with load. pr-waves-blocked.test.ts met the target (0.08 to 0.16s, 3/3 tests), so it stays off the list.
Merged to integration/engine-ship as 2bd59e9 (branch unit/es2-chant-fix-gapsbudget).
npx vitest run test/unit-test-budget.test.ts: 7 passed.lex00 commentedon Oct 26, 2026
Ready for the maintainer (epic:engine-ship round 2, 2026-10-26).
chant main is 9b8fa99 (the merge of integration/engine-ship, tree equal to the tested tip 280be4e; unit suite 29365 passed, 2 budget-only failures under load, no assertion failure). Push CI on main passed (chant run 40407754959).
Ticked item 2: chant run 40407754959 on main 9b8fa99 (push, 2026-10-26 21:50Z) passed all four
test-shardjobs. They runnpx vitest run --project unit --shard=<n>/4with no CHANT_UNIT_TEST_BUDGET_MS override, so the default 5s budget applies. chant.yml runs the same jobs on pull_request, and the listed files stay in the unit project.Load findings from round 2's epic-ready, all on this Mac:
npx vitest run --project unit: 23 tests over 5s while four suites ran at once, and no assertion failure among them. Every one of the 15 files passed when run alone.Left: item 1 (maintainer run). On the 18-core Mac, on chant main 9b8fa99 with
npm ciandbash scripts/ci-lexicon-artifacts.sh --steps generate,bundledone:just check, twice, with CHANT_UNIT_TEST_BUDGET_MS unset. Both should pass.npx vitest run --project unit packages/coreshould report no over-budget test.Run them on a quiet machine. The findings above say other suites running at once are enough to push a 2s test past 5s. A test that goes over only under load fits option (c), making it faster, or a place on the per-file list with its reason.
lex00 commentedon Oct 27, 2026
Finding from consolidation-graph epic-ready (2026-10-26), chant integration f0a894e: in a full
npx vitest run --project unit(2193 files, run while other worktrees were compiling and testing), five tests went over the 5s budget and each passed when its file ran alone right after:These are load flips, the class this issue tracks; none is over budget alone, so none joins SLOW_UNIT_TEST_FILES.
lex00 commentedon Oct 27, 2026
Second full run (consolidation-graph epic-ready round 2, chant integration b6281ef): three budget overruns, each passing 3/3 alone right after:
Also seen by a fixer in round 1: local-executor.test.ts "parallel phase runs steps concurrently (~max, not sum)" at 116ms against its 110ms wall-clock limit under load, then 3/3 passes.
lex00 commentedon Oct 27, 2026
Ready for the maintainer (consolidation-graph, 2026-10-27)
chant main is now 47b8594 (tree equal to the tested tip b6281ef).
What epic-ready showed: two full unit runs on this machine under load (comments above) had five and then three budget overruns, all passing alone right after, none over budget alone, so SLOW_UNIT_TEST_FILES did not grow. pr-loop.tofu.test.ts flipped in both runs and sits close to 5s under load. The second run passed 30275 tests.
Left: item 1 (maintainer run),
just checktwice on the 18-core Mac with the default 5s budget on a quiet machine, plus the packages/core unit run with no over-budget test. Report any test that fails there with its time.Commands: run sheet entry G5 in Run sheet: engine-wt/goals/consolidation-graph-1-runs.md.
lex00 commentedon Nov 20, 2026
The budget also trips in CI shards, and each test passes when the failed jobs rerun. Three runs on 2026-11-20 went over:
packages/core/src/graph-schema/graph-schema.test.ts(run 44689705087, shard 4/4)gate.testpinned-upgrade-multiEach pull request that hits one waits a full rerun before it can enter the merge queue.
lex00 commentedon Nov 20, 2026
More CI shard runs went over the budget on 2026-11-20, each in a file the pull request did not touch. Every one passed when the failed jobs ran again.
retention.test.ts(2),status-mixed.test.tsrelease-floors.test.ts,declared-kinds.test.ts,pr.test.ts,trust.test.tsplan-stale.test.ts,source-release.test.ts,boxes.test.tsThe load scaling raises the limit to about 6.4s at a load of 5 on 4 cores, and these tests take 7 to 12s on the shard, so each pull request in the queue risks one rerun.