# Flaky Test Hunter for CI

> Find tests that pass and fail on the same commit from JUnit XML, rank them by rerun minutes lost, classify the cause with evidence, and fix or quarantine each one with an owner and an expiry date.

Flaky Test Hunter for CI is a paid AI agent skill on Agensi by Signal Over Noise, in Testing & Debugging. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $12 (one-time purchase)
- Creator: [Signal Over Noise](https://www.agensi.io/creators/jammin411)
- Category: [Testing & Debugging](https://www.agensi.io/skills/testing-debugging)
- Version: 1.0.0
- Last updated: 2026-12-01
- Security: scan passed (2026-12-01); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/flaky-test-hunter-for-ci
- Tags: testing, ci-cd, junit, python, automation

## About this skill

Flaky tests cost more than the rerun button suggests. Each one trains the team to ignore red builds, and the usual fix is a retry plugin that hides the problem.

This skill gives your agent a strict definition and a tested script:

- A stdlib Python script that reads JUnit XML from many CI runs (`<testsuites>` or `<testsuite>` roots, skipped tests, failure vs error, Surefire in-run reruns), maps each run to a commit by file name or a CSV, and prints a ranked flake table: runs, failures, flake rate, commits with both outcomes, and the most common failure message.
- A flake is a pass and a fail on the same commit. Tests that fail every attempt on a commit are listed separately as real breakage, so you do not quarantine a regression.
- Ranking by flake rate x runs x rerun minutes, so a flake in an 18-minute integration job outranks two in a 6-minute unit job.
- An evidence table for seven causes (timing, order dependence, shared state, time and date, network, resource limits, randomness) that points at what to read in the XML.
- A quarantine policy with owner, 14-day expiry, a size cap, and a fix playbook per cause, including what is not a fix.
- A full worked example with eight fictional CI runs.

It does not fetch artifacts from your CI, rerun tests, or edit your code by itself.

## Requires

- Python 3.10+ (standard library only)

JUnit XML reports from your CI runs

## Known limitations

Requires Python 3.10+. Needs multiple CI runs per commit to detect flakes. Files must be named with SHA or mapped via CSV. Only supports JUnit XML format.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Flaky Test Hunter for CI skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this skill help me prioritize which flaky tests to fix first?

This skill analyzes JUnit XML artifacts to identify tests that show both passes and failures on the exact same commit. It calculates the financial and time cost of these retries to help teams prioritize fixing the most expensive flakes first.

### What data do I need to provide for the analysis to work?

You must provide JUnit XML files from recent CI runs and a way to map each run to a specific commit SHA, such as through file naming or a CSV map. You also need to provide the estimated wall-time cost of a job rerun and a Python 3.10 plus environment for the analysis script to run.

### What kind of report or output should I expect?

The skill generates a Markdown report containing a ranked table of flaky tests by cost, a list of tests that failed on every attempt, and specific classification of causes like timing, shared state, or network issues. It also produces structured quarantine entries with owners and 14 day expiry dates to manage technical debt.

### Are there any types of test failures that this skill does not cover?

The skill cannot prove a test is flaky if there is only one run for a commit or if the runner uses internal retries that do not record failures in the XML. It also excludes tests that fail every time on a commit, as these are considered legitimate code breakages rather than non-deterministic flakes.

### How should I ask my agent to use this skill?

You can ask your agent to identify flaky tests in a directory of JUnit reports, calculate the cost of CI reruns for a specific window of time, or generate a quarantine list for unstable tests with specific owners and expiry dates.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
