Skip to content

test(enrichment): add flaky-test retry to the review-enrichment suite #2425

Description

@JSONbored

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.gittensor:priorityMaintainer-selected Gittensor priority — scores a 1.5x multiplier.

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions