tezvyn:

How would you diagnose, report, and mitigate E2E flakiness at scale?

AI-drafted, machine-checkedSource: testing.googleblog.comadvanced

Tests metric-driven pipeline hygiene versus retry band-aids. Strong answers baseline flakiness rates, identify offenders via CI history, quarantine chronic flakes from presubmit, and fix root causes like concurrency.

WHAT THIS TESTS: This question probes whether you understand that flakiness is a measurable quality metric that degrades organizational trust and slows releases, not merely an annoyance to be retried away. The interviewer wants to see data-driven triage, systemic mitigation, and a balance between immediate unblocking and long-term prevention.

A GOOD ANSWER COVERS: First, establish metrics and baselines. Cite that Google sees roughly 1.5 percent of all test runs return flaky results and that 16 percent of tests exhibit some flakiness. You would define flakiness as a test producing both pass and fail outcomes against the same code, then instrument CI to track per-test flakiness rates and detect pass-to-fail transitions. Second, diagnose systematically. Mine historical CI data to determine whether a failure is a true regression or a flake; note that at Google about 84 percent of pass-to-fail transitions are flakes rather than legitimate breakages. Third, mitigate without masking. For presubmit, mention practical tactics like rerunning only failing tests or requiring three consecutive failures before reporting, but emphasize these are temporary relief valves. Fourth, quarantine and fix. Propose an automated quarantine system that removes chronically flaky tests from the critical path, files bugs, and targets root causes such as concurrency, non-deterministic behavior, flaky third-party code, or infrastructure variance. Fifth, close the loop. Track the insertion rate versus the fix rate; if they are equal, the system is stuck and process changes are needed.

COMMON WRONG ANSWERS: Proposing endless auto-retries as the primary strategy without tracking flakiness metrics. Suggesting developers simply rerun the pipeline manually until it passes. Ignoring the fact that retry policies delay real failure detection, such as a 15-minute integration test needing three strikes to surface a true breakage after 45 minutes. Failing to mention quarantine or removal from presubmit gates, which forces every developer to pay the tax of investigation. Treating flakiness as purely an infrastructure problem rather than a test-design problem.

LIKELY FOLLOW-UPS: How do you prevent quarantined tests from becoming forgotten dead code? At what flakiness threshold should a test be automatically quarantined? How do you distinguish infrastructure flakiness from product race conditions? What is the cost to developer productivity when 15 out of 1000 tests flake during a release candidate run?

ONE CONCRETE EXAMPLE: Imagine a microservice with 1000 E2E tests where 1.5 percent of runs flake. That means roughly 15 tests fail on every release candidate, forcing a build cop to investigate. Instead of manual triage, you implement CI telemetry that tags any test with a pass-to-fail transition without a code change as a flake. After two weeks of data, you identify 30 tests with nonzero flakiness. The top 5 offenders, each flaking more than 5 percent of the time, are auto-quarantined and removed from presubmit; tickets are auto-filed with ownership tags. The remaining tests get targeted fixes for timing issues and mock stabilization. You keep a dashboard showing insertion rate versus fix rate, aiming to drive the 16 percent flakiness prevalence down over the quarter.

Read the original → testing.googleblog.com

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.