Interview Prep/CI/CD/Metrics, Performance and Cost

How do you detect and manage flaky tests at scale?

AdvancedProductionMetrics, Performance and Cost
Answer

Collect JUnit results from every run in a store (BigQuery, Datadog CI Visibility, BuildPulse, Trunk), and flag tests that both pass and fail on the same commit or alternate without code changes. Auto-quarantine flaky tests into a non-blocking job with an issue assigned to the owning team and a deadline; track flake rate as a team metric; fix root causes (time dependence, shared state, ordering, un-awaited async, port collisions). Limit retries to one and always record that a retry happened.

All CI/CD questions

More on Metrics, Performance and Cost