What are flaky tests and how should a pipeline deal with them?
IntermediateConceptTesting and Quality Gates
Answer
A flaky test passes and fails on the same code, usually due to timing, shared state, test order, external dependencies or time-of-day assumptions. Blanket retries hide the problem and slow the pipeline. Better: detect flakes by tracking pass/fail per test over time, quarantine them into a non-blocking suite with an owner and deadline, fix root causes (fake clocks, isolated data, Testcontainers instead of shared DBs), and report flake rate as a metric.
More on Testing and Quality Gates
What is the testing pyramid?BeginnerWhat is the difference between unit, integration, and end-to-end tests?BeginnerWhat are smoke tests and sanity tests in a deployment pipeline?IntermediateWhat is code coverage and is a high percentage a good target?IntermediateWhat is a quality gate in SonarQube?IntermediateHow do you integrate SonarQube into a CI pipeline and make it block on gate failure?Intermediate