Why rerunning one failed test may hide a much larger reliability problem
One automated test fails.
The team reruns it. It passes.
The pipeline turns green, the release continues, and everyone moves on. Problem solved?
Probably not. 🎭
A successful rerun proves only that the failure did not happen twice in a row. It does not explain why the first failure occurred, whether the same condition affected other tests, or when it will return.
Yet flaky tests are still often handled as isolated problems: one failed script, one investigation, one retry, one ticket.
Recent research suggests that this mental model may be wrong. Flaky tests frequently fail together because they are reacting to the same unstable dependency, environment, shared state, network condition, or timing problem.
The test that caught your attention may be only the loudest member of a much larger group.
Flakiness is not always isolated
A flaky test produces different results without a relevant change to the application or test code. It may pass in one run, fail in the next, and pass again immediately afterwards.
That inconsistency makes the test difficult to trust. But the deeper problem is that teams often analyse each inconsistent result separately.
A 2025 empirical study examined 10,000 test-suite runs across 24 Java projects. The researchers identified 810 flaky tests and found that 75% belonged to a cluster of tests whose failures occurred together. The average cluster contained 13.5 flaky tests. Intermittent networking problems and unstable external dependencies were the predominant shared causes.
The researchers described this pattern as systemic flakiness.
Instead of one unreliable test having one local defect, several tests may be different symptoms of the same underlying instability.
That changes the investigation question.
Instead of asking:
Why did this test fail?
The team should also ask:
Which other tests failed under the same conditions, and what do they share?
What a flaky cluster can look like
Imagine that five automated tests fail during the same nightly run:
- a customer cannot complete checkout;
- an administrator cannot open an order;
- a report does not show the latest transaction;
- an email confirmation is not generated;
- an API test times out while retrieving the order.
Investigated separately, these failures appear unrelated. They belong to different features, pages, and test classes.
However, all five tests depend on the same order-processing service.
If that service starts slowly, loses a database connection, or fails to process a queue message on time, each test may fail differently. One produces a timeout. Another receives incomplete data. A third cannot find the expected record.
Fixing the timeout inside one test will not fix the service problem.
Increasing another test’s wait time may make the suite look healthier while allowing the same instability to remain.
This is why flaky-test analysis needs context beyond the latest error message.
A passing rerun is not a diagnosis
Retries have a legitimate purpose.
They can help a team determine whether a failure is reproducible. They can collect additional logs and provide another data point. In some cases, a controlled retry may temporarily prevent a known infrastructure issue from blocking every delivery.
The problem begins when the retry becomes the resolution.
Automatic retries can turn a red pipeline green without restoring confidence in the test suite. They can also make the cost of flakiness less visible because the pipeline eventually passes.
Over time, the team learns to interpret the first failure as noise.
That creates a dangerous habit. A real product defect may produce a failure that resembles the familiar flaky pattern. When engineers are used to clicking “rerun,” they may dismiss the signal before investigating it.
A retry should therefore answer a question, not close the problem.
For example:
- Does the test fail only on a specific worker or environment?
- Does it fail when executed with other tests but pass in isolation?
- Do several tests fail during the same runs?
The result of a rerun should become evidence for the investigation.
Look for co-occurrence
Test history becomes much more useful when teams stop viewing it as a list of individual pass and fail results.
Start by identifying which failures repeatedly appear together.
Two tests do not need to display the same error message to share a cause. One may time out while another receives incorrect data. The useful signal is that both failures begin during the same runs or under the same conditions.
Compare:
- the build and deployment version;
- environment, browser, worker, container, or device;
- test data, account, user role, and shared dependencies.
This may reveal that several apparently unrelated failures happen only in one test environment, after a specific deployment step, or while using the same external service.
A 2026 study of 649 OpenStack projects found that cross-project flakiness affected 55% of the analysed projects. The researchers identified race conditions in CI, inconsistent build configurations, and dependency mismatches as primary causes of inconsistent flakiness. The findings show how instability can extend beyond one test file or even one project.
The investigation boundary should therefore follow the shared resource, not the folder containing the failed test.
Check when the pattern started
A flaky test may have existed for months, or it may have appeared after yesterday’s infrastructure update.
Those situations require different investigations.
Compare recent runs with a known stable period. Look for the first point where the failure pattern becomes visible, then review what changed around that time.
The trigger may be:
- a dependency or runtime upgrade;
- a change in test parallelisation;
- new test data or cleanup logic;
- an altered deployment sequence;
- an API rate limit or network configuration;
- a test that now leaves shared state behind.
The test itself may not have changed. Its environment may have.
This is especially important when several tests begin failing at approximately the same time. Editing every affected test separately may create more complexity while leaving the trigger untouched.
Group by shared cause, not identical error
Teams often search for duplicate stack traces when looking for related failures.
That is useful, but it is not enough.
The same unstable dependency can produce several errors depending on where each test is when the problem occurs. A slow service might cause a timeout in one test, missing data in another, and an unexpected status code in a third.
Useful grouping dimensions include:
Shared execution context: the same environment, runner, browser, operating system, container, or time window.
Shared dependency: the same API, database, queue, file system, authentication provider, or third-party service.
Shared state: the same account, test data, cache, feature flag, transaction, or cleanup process.
The goal is not to prove immediately that the failures have one cause. It is to create a hypothesis worth testing.
Run the suspected group under controlled conditions. Change one factor at a time. Execute the tests in isolation, in a different order, on another worker, or with a stable replacement for the external dependency.
A cluster becomes actionable when the team can connect co-occurrence to a shared condition.
Do not “fix” flakiness by hiding it
Some common responses reduce visible failures without improving reliability.
Longer waits may hide a race condition. Additional retries may reduce the chance of a red pipeline. Quarantining tests may protect delivery speed. Relaxing an assertion may stop a test from failing.
Each action can be reasonable temporarily, but none should happen without a recorded explanation.
Before changing the test, ask:
- Did the test reveal a real reliability issue in the product, infrastructure, or environment?
- Will this change remove the cause or only make the failure less visible?
- How will we know whether the problem returns?
Quarantine should be a managed state, not permanent exile.
A quarantined test needs an owner, a reason, evidence, and a review point. Otherwise, the suite gradually loses coverage while the dashboard becomes easier to keep green.
Different systems produce different types of flakiness
There is no universal list of flaky-test causes that applies equally to every product.
A 2026 study of fixed flaky-test issues in SAP HANA found that concurrency-related problems were the most common category in that specific system, representing 23% of the analysed issue reports. The researchers also noted that different test types face different flakiness challenges.
That distinction matters.
A browser-based end-to-end suite may struggle with asynchronous UI behaviour, external services, and dynamic selectors. API tests may be more sensitive to rate limits, shared data, or eventual consistency. Unit tests may still become flaky because of concurrency, time, randomness, global state, or inconsistent dependencies.
Teams should use general cause categories as investigation prompts, not as automatic diagnoses.
Build a useful flakiness record
Flaky-test investigations often fail because the relevant context disappears after the run.
A screenshot shows the visible error but not the environment state. A stack trace identifies where the test stopped but not what happened in another dependent service. A defect ticket says “passed after rerun” but does not record which other tests failed at the same time.
For every suspected flaky result, preserve enough information to compare it with future failures:
- build, environment, and execution time;
- error, logs, screenshots, and relevant response data;
- related failures, dependencies, and test data;
- rerun conditions and results;
- current owner and investigation status.
This does not require an elaborate observability platform before the team can begin.
Consistent test-run records are already enough to reveal basic patterns: the same tests failing together, the same environment appearing repeatedly, or a cluster beginning after a particular release.
How TestCaseLab supports the investigation
A test management tool cannot correct a race condition or stabilise an external API.
It can, however, preserve the history and context needed to recognise that several failures may belong to the same problem.
With TestCaseLab, teams can keep automated and manual test cases organised in structured test plans, execute repeatable test runs, and record the result of each check. Testers can attach evidence, document observations, connect defects, and use fields or tags to capture useful context such as the affected component, environment, platform, or risk area.
The Run Again capability allows teams to repeat an existing test run without rebuilding the same test selection manually. This is useful when reproducing a suspected flaky pattern under controlled conditions.
Reports and result history can then help the team compare runs instead of treating each failure as a new isolated event.
TestCaseLab provides the QA layer that connects test cases, execution history, evidence, defects, and investigation decisions in one structured workflow.
That shared record is especially valuable when the pattern spans several tests and requires collaboration between QA, developers, DevOps, and product teams.
Fix the system, not only the script
Flaky tests damage more than the reliability of automation.
They change team behaviour.
Engineers stop trusting failures. Testers spend time repeating executions instead of investigating risks. Pipelines consume additional resources. Releases slow down—or continue despite warnings that no one takes seriously.
Google researchers studying flaky tests across 428 projects found that effective root-cause support depends not only on detection accuracy but also on fitting investigation tools into developer workflows and making debugging information easy to use.
That is the practical lesson.
Finding a flaky test is not the end of the task. The team needs enough context to turn an unreliable signal into an understandable problem.
The next time one test fails and passes on rerun, do not ask only whether the pipeline is green again.
Ask:
What else failed with it?
When did this pattern begin?
Which environment, dependency, data source, or setup process do these tests share?
The fastest way to fix several flaky tests may be to stop treating them as several problems.


