Tests Pass Locally, Fail in CI. Just Retry?

Your suite is green on your laptop but red in CI. A teammate wants to add a retry and re-run until green. Defend what you actually do.

beginner8 min4 roundsEasy mode availableCI/CD

Answer key reviewed by Branko Petric

Read first: Building a CI Pipeline with GitHub Actions

Your decision

Your test suite passes on your laptop but fails in CI. A teammate says CI is just flaky, add a retry and re-run until it is green. What do you do, and why?

The situation

Your CI pipeline keeps failing a handful of tests, but the exact same tests pass every time on your laptop. Re-running the job sometimes makes it green.

Context

The project does not pin all dependency versions, CI runs on a different OS than your laptop, and a few tests touch dates and a shared temp directory. A teammate suggests adding automatic retries so the build goes green and stops blocking the release.

More: CI/CD scenario interview questions