Skip to content

Local unit budget: pr-waves-blocked.test.ts flips over 5s under load #4502

Closed

Description

@lex00

At epic:engine-ship's epic-ready, packages/core/src/cli/handlers/pr-waves-blocked.test.ts went over the 5s unit budget in two full-suite runs (5.2s, 5.7s), passed 3/3 alone, and takes the same time on main. intent-gaps.test.ts went over once. Neither is on #4472's named slow list. A third full run was clean. Speed them up or decide how the budget treats load.

Follow-up from epic:engine-ship (filed at epic-ready, 2026-10-26).

Activity

  1. added
    epic:engine-ship
    on Oct 26, 2026
  2. lex00 commented on Oct 26, 2026

    @lex00
    ContributorAuthor

    Ruling for epic:engine-ship round 2 (2026-10-26): make pr-waves-blocked.test.ts and intent-gaps.test.ts fast (shared fixtures, fewer subprocesses); the 2.5s-alone target is measured at epic-ready, and a file that misses it joins #4472's per-file budget list with the reason.

  3. lex00 commented on Oct 26, 2026

    @lex00
    ContributorAuthor

    Merged into integration/engine-ship at 00a422d (unit branch unit/es2-chant-4502). Only the two test files changed.

    What landed:

    • packages/core/src/cli/handlers/pr-waves-blocked.test.ts: every pr-plan and pr-apply run read the declaration at the fake base, and the working tree's, through git in this checkout: prLoopHooksAt, prLoopPolicyAt, securityGroupsAt, ciLocksAt and, on the plan, newMigrationFilesBetween. They are now mocked to read as a declaration that sets none (the result they gave before, since chant's own declaration sets no hooks, policy, review-rules or locks), so the ten runs in the file start no git processes for them. The test also stops depending on chant's own chant.workspace.json. The pull request is planned once per file: every test starts from the same estate, so the digest is the same, and each test approves it on its own ledger. pr-apply does not read pr-plan.json, so the applies are unchanged.
    • packages/core/src/workspace/intent-gaps.test.ts: the tests that only read a region share one walk of it (seven walks become two). The test that edits dec-003 in the working tree walks afresh.

    tsc --noEmit -p packages/core is clean apart from the existing TS6059 noise. Not run.

    Still missing (waits for epic-ready): the 2.5s-alone measurement of both files (3 runs each). A file that misses it joins #4472's per-file budget list with the reason, per the ruling.

  4. lex00 commented on Oct 26, 2026

    @lex00
    ContributorAuthor

    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.

  5. lex00 commented on Oct 26, 2026

    @lex00
    ContributorAuthor

    Epic-ready (epic:engine-ship round 2, 2026-10-26): closing, per the ruling. Merge 00a422d made both files faster. Measured alone, three runs each: pr-waves-blocked.test.ts 0.08s to 0.16s, so it met the 2.5s target and stays off the list. intent-gaps.test.ts took 5.4s, 14.9s and 16.9s (slowest test 1.8s, 4.7s, 5.9s), so it missed, and run 3 failed the 5s budget on a test that passes in runs 1 and 2. That flip comes with load. It joined SLOW_UNIT_TEST_FILES at 2bd59e9, with the reason in a comment (it walks real git history per test). unit-test-budget.test.ts (7) passed on 280be4e, and neither file went over budget in the final full run.

    chant main is 9b8fa99, the merge of integration/engine-ship with its tree equal to the tested tip 280be4e. Epic-ready on 280be4e: npm ci, scripts/ci-lexicon-artifacts.sh --steps generate,bundle, npx tsx scripts/typecheck.ts with no regressions (26 baselined), and npx vitest run --project unit with 29365 passed and 2 failed, both 5s budget overruns under load with no assertion failure (#4472). Push CI on main 9b8fa99 passed: chant run 40407754959 (check and the four unit shards).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic:engine-ship

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions