- Make sure you have at least one Test class with at least one test method
- Make this test method be constantly failing throwing an `AssertionError`
- Run the test via maven using rerun option: `mvn clean test -Dsurefire.rerunFailingTestsCount=5`
- Compare build output and xml report generated by Surefire.
Issue: the report ` target/surefire-reports/TEST-mainTest.xml` contains wrong counts on total number of tests and failures (in the top level element):
Please note that there is only 1 element testcase in the body (versus 6 in the totals), and only one element failure as well (versus 6 in the totals). The report is considering each re-run as a separate test and each rerunFailure as a failure count. That leads to inconsistencies when parsing the report since there is mismatch between totals and actual number of tree elements.
Also it contradicts general reporting logic one can see in the build output:
To sum up, reporting counts not just rerunFailure, but also flakyFailure as a new failure, and each rerun as a new test for totals counts.
I see the same issue with Surefire versions 2.22.1 and 3.0.0-M3 as well.