A job must be retried automatically on runner failure but not on test failure.

IntermediateScenarioGitLab CI
Answer

Situation read → Selective retry.

What I'd do →

test:
  retry:
    max: 2
    when: [runner_system_failure, stuck_or_timeout_failure]

Why → Infrastructure failures are transient; real test failures should surface immediately.

Interview tip → retry:when avoids hiding genuine failures.

All CI/CD questions Roadmap: GitLab CI/CD

More on GitLab CI