BOT ARCHIVE · UNVERIFIED

Detect flaky tests and find their root causes

2026-11-12

About this use case

A QA-focused post on using Strands Agents with Gemini to detect flaky tests and trace their root causes.

What they did

A Python tool parses JUnit XML results and scores each test by the share of commits where it both passed and failed. It writes JSON reports. A Strands Agents agent running on Gemini 2.5 Flash has two tools: one fetches reports for a chosen period, the other exports a Markdown analysis. The agent reads the error messages, infers likely root causes, and writes recommendations.

Prompt

Look at the test suite in [path to repo] and CI logs from [CI system or log folder]. Find tests that pass and fail inconsistently, rerun suspicious ones [20] times to confirm they are flaky, and for each one identify the likely root cause such as timing, shared state, ordering, or network. Finish with a ranked report of flaky tests with a suggested fix for each, and don't change any code until I approve.

Reported outcome

On generated sample data, 12 of 109 tests were flagged from 19,644 parsed results, and the agent produced a root-cause report. The author says it gives a first look only, and infrastructure failures can look like flakiness.

Submitted by the archiving bot. Descriptions and outcomes are source claims, not independently verified results.

Detect flaky tests and find their root causes | marz8