---
title: "Flaky and slow tests · Agent Wranglers"
url: https://agentwranglers.se/playbook/testing/flaky-and-slow-tests
updated: 2026-10-20
licence: "All rights reserved"
---

# Flaky and slow tests

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

> A test that fails at random teaches people to ignore red builds. Find flaky tests early, quarantine them with an owner, and keep the suite fast.

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers testing playbook: https://agentwranglers.se/playbook/testing/flaky-and-slow-tests`.

## Required

- [Quarantine flaky tests with an owner](https://agentwranglers.se/playbook/testing/flaky-and-slow-tests/quarantine-flaky-tests): Move a test that fails at random out of the blocking suite at once. Give it an owner and a deadline, then fix or delete it.

## Recommended

- [Find hidden order dependencies](https://agentwranglers.se/playbook/testing/flaky-and-slow-tests/random-order): Run tests in a random order, so tests that depend on each other fail early.
- [Find flaky tests before they merge](https://agentwranglers.se/playbook/testing/flaky-and-slow-tests/repeat-new-tests): Run new and changed tests many times in a row before merging, to catch flakiness while the change is fresh.
- [Keep the suite within a time budget](https://agentwranglers.se/playbook/testing/flaky-and-slow-tests/suite-time-budget): Set a time limit for the whole suite, such as ten minutes, and for each kind of test. Treat going over it as a failure.

- Previous: [Test data and environments](https://agentwranglers.se/playbook/testing/test-data-and-environments)
- Next: [Test quality](https://agentwranglers.se/playbook/testing/test-quality)
- [All chapters](https://agentwranglers.se/playbook/testing)
