Repository navigation
test: pin doctor's latest-version lookup; move two cold-import costs off the 5s unit test budget - #1063
Merged
Conversation
…off the 5s unit test budget Follow-up to the #1062 review, where three unrelated test failures rotated through full-suite runs on main: - doctor.test.ts: two scenario assertions depended on the live npm registry via checkVersionThorough(), so they failed on the day 2.15.1 was published while the branch still said 2.15.0. The module is now partially mocked (importOriginal + a pinned up-to-date result), the same class of fix as #1056's snapshot pin. - tui/load.test.ts: the first loadTui() paid the cold Ink/React import (~5 s under load) inside a test with the unit project's 5 s testTimeout. The import is now warmed in beforeAll (60 s hookTimeout); loadTui() sets/restores NODE_ENV on every call, so the restore behaviour each test guards is unchanged. - version-preflight.docs.test.ts: the one async test did an await import() of the manifest/version-check graph inside its 5 s budget. Hoisted to a static import (precedent: version-preflight.test.ts), paid at collection time. No tolerance was widened; the unit project keeps its 5 s default. Claude-Session: https://claude.ai/code/session_01LKP1FKm7sK7PEegt7vWhaJ Entire-Checkpoint: bd730d3b45a1
admarble
deleted the
test/doctor-version-pin-and-import-heavy-timeouts
branch
September 15, 2026 22:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up from the #1062 review, where three unrelated test failures rotated through full-suite runs on
main. Test-only; no source changes.src/commands/doctor.test.ts— two scenario assertions (warns when jq is not installed,all checks pass when everything is installed and configured) depended on the live npm registry viacheckVersionThorough(). They failed on 2026-09-15 because 2.15.1 had just been published while the branch under test still said 2.15.0. The module is now partially mocked (importOriginal+ a pinned up-to-date result) — the same class of fix as test(agents-md): pin the package version in the per-stack snapshots so releases don't break them #1056's snapshot pin.src/ui/tui/load.test.ts— the firstloadTui()paid the cold Ink/React import (~5 s under full-suite load) inside a test with the unit project's 5 stestTimeout. The import is now warmed inbeforeAll(60 shookTimeout).loadTui()sets/restoresNODE_ENVon every call regardless of the module cache, so the restore behaviour each test guards is unchanged.src/commands/version-preflight.docs.test.ts— the oneasynctest did anawait import()of the manifest/version-check graph inside its 5 s budget. Hoisted to a static import (precedent:version-preflight.test.ts), paid at collection time.No tolerance was widened: the
unitproject keeps its 5 s default, per the rationale invitest.config.ts.Verification
main-equivalent trees showed 2–3 rotating failures each time (doctor×2;batch-executorbug-label;version-preflight.docs;tui/load).npm run lintclean;tsc --noEmitclean.Mutation-verified: doctor pin — flipped the mocked result to
latestVersion: "9.9.9-test", isOutdated: true;warns when jq is not installedandall checks pass when everything is installed and configuredfailed (2 failed / 47 skipped); restored.The other two changes remove a timing dependency rather than gate a claim, so a deterministic mutation isn't available for them; the full-suite result above is the evidence.
🤖 Generated with Claude Code