Interview Prep/CI/CD/Builds, Artifacts, Nexus, SonarQube and Testing

A team has a test suite where 5% of tests fail randomly. How do you deal with flaky tests?

IntermediateScenarioBuilds, Artifacts, Nexus, SonarQube and Testing
Answer

Situation read → Flakiness erodes trust in CI.

What I'd do →

  1. Detect: track pass/fail history per test and flag those that flip with no code change.
  2. Quarantine: move flaky tests to a non-blocking job with an owner and ticket.
  3. Fix root causes: shared state, time, ordering, network, async waits.
  4. Do not auto-retry everything; allow limited retry that is reported.

Why → Silent retries hide problems while quarantine keeps the gate trustworthy.

Interview tip → Report flaky rate as a metric.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Builds, Artifacts, Nexus, SonarQube and Testing