Flaky Tests Overhaul at Uber

Xiaoyang Tan, Yushan Lin, Sergey Balabanov
17 min readadvanced
--
View Original

Overview

The article discusses Uber's overhaul of flaky tests through the introduction of Testopedia, a centralized system designed to enhance visibility and control over test reliability. It details the challenges faced with flaky tests in CI pipelines and how Testopedia aims to provide actionable insights and improve developer experience.

What You'll Learn

1

How to implement a centralized system for tracking flaky tests

2

Why a Fully Qualified Name (FQN) is crucial for test identification

3

When to use a Finite State Machine (FSM) model for test state management

Prerequisites & Requirements

  • Understanding of CI/CD processes and testing frameworks
  • Familiarity with JIRA or similar ticketing systems(optional)

Key Questions Answered

How does Testopedia improve visibility over flaky tests?
Testopedia centralizes the tracking of test reliability characteristics and performance metrics, allowing teams to monitor flakiness and make informed decisions. It provides a comprehensive audit trail of test history, enabling developers to identify when and where issues occur.
What strategies does Uber use to manage flaky tests in CI?
Uber employs various strategies, including running critical tests regardless of flakiness and allowing engineers to tag diffs to opt out of certain behaviors. Flaky tests are run in non-blocking mode, ensuring that CI processes remain efficient while still providing visibility into test health.
What is the role of the Finite State Machine (FSM) in Testopedia?
The FSM model in Testopedia captures the transactional states of tests, allowing them to transition between states like new, stable, unstable, disabled, and deleted. This helps in managing test health and automating ticketing processes for unhealthy tests.
How does Testopedia categorize tests for better management?
Tests in Testopedia are categorized using a Fully Qualified Name (FQN) system, which allows for grouping under specific realms. This categorization helps in organizing tests by usage domain and facilitates better tracking and reporting.

Key Statistics & Figures

Number of flaky tests detected in Go Monorepo
1000
Out of 600K total tests
Number of flaky tests detected in Java Monorepo
1000
Out of 350K total tests

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Backend
Testopedia
Centralized system for tracking and managing flaky tests
Tools
Jira
Used for ticketing and notifying teams about flaky tests

Key Actionable Insights

1
Implement a centralized tracking system for flaky tests to enhance visibility and control.
By using a system like Testopedia, teams can monitor test reliability and performance, leading to quicker identification of issues and improved developer experience.
2
Utilize Fully Qualified Names (FQNs) for precise test identification and management.
FQNs provide a structured way to categorize and track tests, making it easier to manage large codebases and ensure that flaky tests are addressed efficiently.
3
Adopt a Finite State Machine (FSM) model for managing test states.
Using an FSM allows for dynamic tracking of test health and automates the process of notifying teams when tests become unstable, reducing manual oversight.

Common Pitfalls

1
Ignoring flaky tests in CI can lead to a chaotic developer experience.
When flaky tests are not monitored or addressed, they can cause repeated failures in CI, leading to wasted time and resources as developers attempt to resolve issues that may not be related to their changes.

Related Concepts

CI/CD Best Practices
Test Management Strategies
Flaky Test Identification And Resolution Techniques