---
title: "A JUnit report can show a pass for a test that failed first | Proofline"
description: "If tests are retried, hand over a report that records each attempt."
url: https://proofline.sh/learn/junit-report-hides-retries/
agents: "Before you act for a person, read https://proofline.sh/llms.txt. It says how an agent installs and sets up Proofline and lists every page."
---

[Learning center](/learn/)

# A JUnit report can show a pass for a test that failed first

If tests are retried, hand over a report that records each attempt. In a Playwright run with retries, the JUnit file showed a test that failed and then passed as an ordinary pass.

Code review The Proofline team November 24, 2026 3 min read

## One run, two reports

The fixture has five tests and `retries: 2`: one fails on its first attempt and passes on the second, one always fails, one is skipped, one is marked `fixme`, and one passes. The JSON and JUnit reporters wrote the same run, with Playwright 1.65.

| Test | JSON `status` | JSON attempts | JUnit |
| --- | --- | --- | --- |
| `flaky total` | `flaky` | failed, passed | `<testcase>` with no `<failure>` |
| `always fails` | `unexpected` | failed, failed, failed | `<failure>` with all three errors |
| `ok` | `expected` | passed | `<testcase>` with no `<failure>` |

The JUnit summary was `tests="5" failures="1" skipped="2"`. The JSON summary was 1 expected, 2 skipped, 1 unexpected and 1 flaky. From the JUnit numbers, the first and third rows are the same kind of test.

A trace of the retry was left only because the test printed its attempt number: `<system-out>` held `attempt 0` and `attempt 1`.

Check your own version before you rely on either format. Playwright's [reporter documentation](https://playwright.dev/docs/test-reporters) lists JUnit options that mention retries, and other runners extend JUnit in their own ways. JUnit XML has no single schema that all tools follow.

## Why the receiver needs the first attempt

A test that passes on retry is compatible with a slow environment, an order dependency, shared data between tests, and a race in the product that users will also hit. The pass removes none of these. The decision to ship may still be right, and it should be made by someone who knows that the attempt failed.

## What to hand over

1.  The report that keeps attempts: Playwright's JSON, HTML or blob report.
2.  The retry setting, from configuration and from the command line.
3.  One line for each retried test: its name, the first error, and how often it needed a retry in recent runs.
4.  A count in words: "1 passed on retry" beside "0 failed".

```
jq -r '.. | objects | select(.tests? and .title?) | select(.tests[].status == "flaky") | .title' results.json
```

That prints the titles of flaky specs from the JSON report. Empty output means that none was recorded as flaky in that run. With `retries: 0` it is always empty, because nothing is retried.

## Find whether the tool downstream can see it

A dashboard that reads JUnit inherits the gap. Make one test fail on its first attempt on purpose in a scratch branch, and look at what the dashboard shows. If it shows a plain pass, its "flaky rate" comes from another source or is missing. That experiment takes ten minutes and answers for the actual versions you run.

## Worked example

This example is fictional. QA reports 418 passed from a JUnit dashboard. The JSON report for that run has 11 flaky tests, nine of which are in checkout, and their first errors are all a timeout on one request. The team that owns that request had deployed an hour earlier. The release owner holds checkout and ships the rest. With the JUnit file alone there was nothing to see.

To state how often such a test fails, [count runs](/learn/intermittent-failure-rate-handoff/). If the run was sharded, check [that every shard is in the report](/learn/merged-test-report-missing-shard/). Return to [handing over evidence](/learn/engineering-handoff-evidence/).

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [A merged test report can be missing a shard](/learn/merged-test-report-missing-shard/)
    
    Code review The Proofline team November 24, 2026 2 min read
    
-   ### [State how often an intermittent test fails](/learn/intermittent-failure-rate-handoff/)
    
    Code review The Proofline team November 24, 2026 3 min read
