redline
MediumTests and CItest-retry

Retries a flaky test

Retries a flaky test. Retries hide flakiness (retries: 2). A test that passes on the second try is still broken.

This is how the comment reads inline, under the flagged line.

Why it matters

Auto-retries turn real races and order bugs into green builds. The flake is still there, now invisible.

What to do

Find why it flakes and fix that. Quarantine with an owner if you must, never blanket retries.

Examples

Flagged
export default { retries: 2 };
Better
export default { retries: 0 };

What it catches

It reads a pattern on each line, aware of strings and comments. Languages: Any file. Scope: All files. These cases are the rule's own tests: the first set must be flagged and the second must not.

Flagged

playwright.config.ts
export default { retries: 2 };

Left alone

playwright.config.ts
export default { retries: 0 };

Research

Automatic retries for flaky tests. A real race or ordering bug becomes a green build.

  • skill: ci-integrity-audit

Turn it off or change it

In a config file for the CLI, or in the API's rules field:

{
  "rules": {
    "disable": [
      "test-retry"
    ],
    "severity": {
      "test-retry": "low"
    }
  }
}

Read the source or report a false positive.