The Importance of Discerning Flaky from Fault-triggering Test Failures: A Case Study on the Chromium CI

Guillaume Haben, Sarra Habchi, Mike Papadakis, Maxime Cordy, Yves Le TraonarXiv 2023 · DOI

Abstract

Machine learning models designed to identify "flaky tests"—those that pass or fail inconsistently without code changes—often inadvertently lead developers to ignore genuine regression bugs. By analyzing the Chromium Continuous Integration (CI) pipeline, this study demonstrates that traditional test-focused classification misses over 76% of actual faults. We propose a shift from predicting whether a test is flaky to predicting whether a specific test failure is flaky, incorporating dynamic execution features to improve accuracy.

Introduction

In modern software development, flaky tests are a significant burden, creating false alarms that waste developer time and undermine trust in automated testing. To mitigate this, researchers have developed high-precision models to flag flaky tests. However, a critical oversight exists: a test can be inherently flaky yet still capable of catching a real bug. If a tool labels a test as "flaky," developers may reflexively ignore its subsequent failures, potentially missing critical regressions. This study investigates this "missed fault" problem and argues for a failure-centric approach to classification.

Methodology

The authors conducted a large-scale empirical study by replicating state-of-the-art flakiness prediction methods and applying them to the Chromium project. The core methodology involved shifting the classification target from the test level to the individual failure level.

Ground Truth Labeling

To establish a reliable dataset, the study utilized Chromium's existing rerun strategy. As shown in the flowchart below, a test failure is categorized based on its behavior during immediate retries.

Chromium rerun strategy for labeling test failures.

If a test fails initially but passes in any of the five subsequent retries, it is labeled Flaky. If it fails consistently across all retries, it is labeled Fault-triggering (a regression).

Feature Engineering

While previous models relied heavily on static "vocabulary-based" analysis (searching for keywords like sleep or timeout), this study introduced dynamic features from the CI environment. These features provide context about the specific execution instance.

Key features used in the failure-focused classification model.

Key dynamic features include the flakeRate (the historical frequency of flakiness over the last 35 commits) and runDuration. The researchers employed a Balanced Random Forest to train their classifier, specifically addressing the extreme class imbalance where real faults are significantly rarer than flaky failures.

Dataset and Scale

The study analyzed a massive dataset from the Chromium CI (Linux Tester), spanning nine months in 2022. The scope included:

  • 10,000 consecutive builds.
  • 1.8 million test failures across over 200,000 unique tests.

Key Insights

  • Flaky Tests as Bug Hunters: Surprisingly, flaky tests were found to reveal more than one-third of all regression faults in Chromium. Disabling these tests entirely would significantly degrade the suite's bug-detection capability.
  • The Precision Trap: While existing models achieve 99%+ precision in identifying flaky tests, applying them to a live pipeline results in a 76.2% false-positive rate for fault-triggering failures. This means the models frequently mislabel real bugs as mere flakiness.
  • Historical Context: 87.9% of flaky tests had a history of flakiness. Incorporating this "historical flake rate" proved to be a powerful predictor.
  • Dynamic Advantage: Adding dynamic execution data nearly doubled the model's effectiveness, as measured by the Matthews Correlation Coefficient (MCC), compared to static analysis alone.

Results and Discussion

The shift to a failure-focused model yielded measurable improvements. Using static features alone, the MCC rose from 0.20 to 0.25. When equipped with dynamic features like run duration and flake rate, the MCC jumped to 0.42.

Despite these gains, the authors note that the performance is not yet fully "actionable" for a fully automated system. A model that still misclassifies a significant portion of real bugs as flakiness cannot be trusted to automatically ignore failures without human oversight.

Conclusion

To effectively manage CI noise, the research community must move beyond identifying flaky tests and focus on interpreting individual failures. Future work should prioritize failure-cause interpretation—providing developers with the why behind a failure—to facilitate fixing flakiness rather than simply suppressing it.

Summary updated

BibTeX
@misc{haben2023importance,
  author = {Guillaume Haben and Sarra Habchi and Mike Papadakis and Maxime Cordy and Yves Le Traon},
  title = {{The Importance of Discerning Flaky from Fault-triggering Test Failures: A Case Study on the Chromium CI}},
  year = {2023},
  eprint = {2302.10594},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.10594},
}
Figure