Skip to content

test(cli): give each complete-journal invariant case its own test - #628

Merged
Makisuo merged 1 commit into
chore/unvendor-llm-to-opencode-aifrom
fix/cli-archive-journal-test-timeout
Aug 25, 2026
Merged

test(cli): give each complete-journal invariant case its own test#628
Makisuo merged 1 commit into
chore/unvendor-llm-to-opencode-aifrom
fix/cli-archive-journal-test-timeout

Conversation

@Makisuo

@Makisuo Makisuo commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #626.

Why

retains a complete journal unless every implied durable invariant is exact in apps/cli/test/archive-generation.test.ts looped a table of seven scenarios inside a single it. Each case seeds a whole archive on disk — manifest, shard, pointer, catalog, pin, scratch, building — so one 5s budget had to cover the sum of all seven.

It timed out on a loaded CI runner at 5002.38ms, a 2ms margin, and took #626 red with it. That PR touches nothing in apps/cli; a re-run of the same commit went green, which is what identified this as structural rather than a real failure.

What changed

The scenario table is hoisted to COMPLETE_JOURNAL_CASES and emitted as one it per case.

  • Each case gets its own budget. Locally the seven cost ~6-8ms each; previously their sum raced a single 5s timeout, now none of them is near one.
  • A failure names the invariant. retains a complete journal when the pin invariant is inexact instead of one test name plus an assertion message identifying the iteration.
  • Better isolation. Each case gets its own temp archive via withArchive rather than sharing one parent directory across all seven.

Nothing under test changes: same seven mutations, same expected rejection patterns, same retained-journal assertion.

Note on scope

This removes the amplification — seven cases sharing one budget — which is the part that made a marginal runner stall fatal. It is not a claim that the underlying CI slowness is explained: the aggregate is ~48ms locally against 5002ms on CI, and I did not chase that gap. I deliberately did not raise the timeout, since an explicit bump would mask a genuine hang rather than fix the shape of the test.

Verification

  • bun run --cwd apps/cli test — 517 pass, 0 fail (was 511; +7 cases, −1 combined)
  • bun run --cwd apps/cli typecheck, bun run lint, oxfmt --list-different clean

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

`retains a complete journal unless every implied durable invariant is exact`
seeded a full archive on disk for each of seven scenarios inside a single
`it`, so one 5s budget covered the sum of all seven. It timed out on a loaded
CI runner at 5002.38ms — a 2ms margin — and took an unrelated PR red with it.

Splitting the table into one test per scenario gives each case its own budget
and removes the structural amplification: the seven cases cost ~7ms each
locally, and a failure now names the invariant in the test name instead of
relying on the assertion message to say which iteration blew up.

No behaviour under test changes: the same seven mutations, the same expected
rejections, the same retained-journal assertion. Each case now gets its own
temp archive rather than a shared parent, which is also better isolation.
@Makisuo
Makisuo merged commit f4f999a into main Aug 25, 2026
4 checks passed
@Makisuo
Makisuo deleted the fix/cli-archive-journal-test-timeout branch August 25, 2026 12:51
@github-actions

Copy link
Copy Markdown

🍁 Maple PR preview

Warning

Preview cleanup could not be confirmed. The Alchemy teardown outcome was skipped.

Final commit 0dd7e21 · View workflow run

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant