maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Pustovoyt (Jira)" <>
Subject [jira] [Created] (SUREFIRE-1821) Broken junit report when parallel and rerunFailingTestsCount is used
Date Wed, 15 Jul 2020 12:40:00 GMT
Pavel Pustovoyt created SUREFIRE-1821:

             Summary: Broken junit report when parallel and rerunFailingTestsCount is used
                 Key: SUREFIRE-1821
             Project: Maven Surefire
          Issue Type: Bug
          Components: Maven Failsafe Plugin, Maven Surefire Plugin
    Affects Versions: 3.0.0-M5, 2.22.2, 2.20.1
            Reporter: Pavel Pustovoyt


When using *parallel* configuration with *rerunFailingTestsCount* bad xml report is generated
for a failing test.

*How to reproduce:*

1. Configure forkCount, parallel and rerun count:
2. Create a failing test that outputs more than 1m characters:
public class AppTest {
    public void testBug() {
        for(int i = 0;  i < 100000; i++){
            System.out.println("Some output longer than 10 character");
        throw new NullPointerException();
3. Run the test and check the report - you will see unexpected end of xml file:
    <property name="" value="UnicodeBig"/>
    <property name="java.class.version" value="52.0"/>
  <testcase name="testBug" classname="" time="0.015">
    <error type="java.lang.NullPointerException"><![CDATA[java.lang.NullPointerException
    <system-out><![CDATA[  <-- EOF
*Possible cause:*

It seems that Junit 4.7 Runner considers each rerun as a separate test set, so sends _testSetCompleted_
event each time, but after the first event _DeferredFileOutputStream_ and associated with
it temp file gets freed(deleted), however _testSetCompleted_ event for rerun still tries
to write something there. If temp file isn't yet created (still in memory) then there will
be no bug and it gets created only after 1m characters were written to the stream. I wasn't
able to understand wether multiple _testSetCompleted_ events is a bug here or a "rerun" trying
to write to _DeferredFileOutputStream_ of initial test run.


*Project to reproduce:*


This message was sent by Atlassian Jira

View raw message