> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trunk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Flaky Tests: Failure Count Monitor

> Flag tests the moment they accumulate a configured number of failures on monitored branches.

**You can now flag tests as soon as they accumulate a configured number of failures — no failure-rate math, no minimum sample size required.**

The new **failure count monitor** reacts to individual failures within a rolling time window, making it well-suited for stable branches like `main` where any single failure is meaningful. Set it up with a failure count (default: 1), a window, a resolution timeout, and the branches to watch.

Common uses:

* **Stable branch alerting** — flag any test that fails on `main`, even once.
* **Post-merge regression detection** — catch regressions before a failure-rate monitor accumulates enough data to trigger.
* **Merge queue / release branches** — quick alerting on branches where failures are suspicious by definition.

A live **Preview** panel shows which tests would be flagged under your current settings before you save, so you can tune the threshold with confidence.

[Read the docs](/flaky-tests/detection/failure-count-monitor) to learn more.
