Related: #1827 (CI reliability / self-host hardening, milestone 16)
Context
The main backend suite (vitest.config.ts) has retry: 1 specifically because a single transient flake must not red a required check and one-shot-close a contributor PR. review-enrichment/'s own test suite (node --test --experimental-strip-types "test/**/*.test.ts", run via npm run rees:test / rees:test in CI) has no equivalent retry configured.
Observed directly during an unrelated local CI-speed investigation: buildBrief stays fail-open and captures a degraded analyzer in review-enrichment/test/sentry-degradation.test.ts failed once (expected "degraded", got "capped") and passed cleanly on an immediate re-run with no code changes — a non-deterministic failure, not a real regression.
Requirements
- Add retry tolerance to
review-enrichment's test invocation (Node's built-in test runner supports --test-retries=N), matching the main suite's one-retry-before-fail policy.
- Investigate
buildBrief stays fail-open and captures a degraded analyzer specifically — is it timing-sensitive, order-dependent, or reliant on shared/global state that can bleed between tests — and fix the root cause if it's cheap to do so, independent of adding retry tolerance.
- Audit whether any other
review-enrichment tests share the same class of flakiness.
Acceptance criteria
rees:test / npm --prefix review-enrichment test retries a failed test once before failing the run, consistent with the main suite's policy.
- The observed flaky test either has a diagnosed root cause with a fix, or is confirmed to only need the retry tolerance.
Validation
npm run rees:test (or npm --prefix review-enrichment test) green, including a deliberate re-run to confirm the flaky test no longer fails intermittently.
Related: #1827 (CI reliability / self-host hardening, milestone 16)
Context
The main backend suite (
vitest.config.ts) hasretry: 1specifically because a single transient flake must not red a required check and one-shot-close a contributor PR.review-enrichment/'s own test suite (node --test --experimental-strip-types "test/**/*.test.ts", run vianpm run rees:test/rees:testin CI) has no equivalent retry configured.Observed directly during an unrelated local CI-speed investigation:
buildBrief stays fail-open and captures a degraded analyzerinreview-enrichment/test/sentry-degradation.test.tsfailed once (expected"degraded", got"capped") and passed cleanly on an immediate re-run with no code changes — a non-deterministic failure, not a real regression.Requirements
review-enrichment's test invocation (Node's built-in test runner supports--test-retries=N), matching the main suite's one-retry-before-fail policy.buildBrief stays fail-open and captures a degraded analyzerspecifically — is it timing-sensitive, order-dependent, or reliant on shared/global state that can bleed between tests — and fix the root cause if it's cheap to do so, independent of adding retry tolerance.review-enrichmenttests share the same class of flakiness.Acceptance criteria
rees:test/npm --prefix review-enrichment testretries a failed test once before failing the run, consistent with the main suite's policy.Validation
npm run rees:test(ornpm --prefix review-enrichment test) green, including a deliberate re-run to confirm the flaky test no longer fails intermittently.