test(enrichment): add flaky-test retry to the review-enrichment suite - #2436
Conversation
Node's built-in test runner (used by review-enrichment) has no --test-retries flag (unlike vitest's retry: 1 in the main suite), so add a shell-level retry that reruns the full suite once on failure — matching the main suite's one-retry-before-fail policy. Root cause of the observed flake in 'buildBrief stays fail-open and captures a degraded analyzer': the test used budget.timeoutMs=200, but the balanced profile's responseReserveMs floors at 150ms, leaving only ~50ms of execution headroom. Under CI load the pre-flight budget gate in runAnalyzer (brief.ts:248-262) short-circuits to 'capped' before the analyzer runs at all, so the expected 'degraded' status is never reached. Raising the budget to 2000ms gives ~1600ms of headroom, deterministically reaching the analyzer throw path. Closes JSONbored#2425
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-02 04:31:32 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 4 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Closes #2425.
What changed:
ode --test ... || node --test ...\ in the npm script.
esponseReserveMs\ floors at 150ms, leaving only ~50ms of execution headroom. Under CI load, the pre-flight budget gate in
unAnalyzer\ (\�rief.ts:248-262) short-circuits to \capped\ before the analyzer runs at all, so the expected \degraded\ status is never reached. Raising the budget to 2000ms gives ~1600ms of headroom, deterministically reaching the analyzer throw path.
Rationale: A single transient flake must not red a required check and one-shot-close a contributor PR. The main vitest suite already has
etry: 1\ for this; the REES suite (Node's built-in test runner) had no equivalent.
Files changed:
eview-enrichment/package.json\ — added shell-level retry to the \ est\ script
eview-enrichment/test/sentry-degradation.test.ts\ — raised \�udget.timeoutMs\ from 200 to 2000 and updated the \capturedTimeoutMs\ assertion bound
Validation:
pm --prefix review-enrichment test\ — 358/360 pass (2 sentry-upload tests fail locally due to missing sentry-cli binary; pass in CI)
Linked issue: Closes #2425