Hi Ryan,

I found this issue already reported in JIRA.
https://issues.apache.org/jira/browse/SUREFIRE-1556

There is no fix because we have not received any reproducible project.

IMO this section should not exist in the XML:

< message="This is a bug">

      <system-out><![CDATA[...]]></system-out>

      <system-err><![CDATA[...]]></system-err>

    </>

It looks like the message is XML attribute used as an element.

I checked the StatelessXmlReporter  right now but i could not find any
logical reason for this issue.
I have really no idea what code and how injected this section into the XML
file.

Here is the method which is responsible for writing the system-out and
system-err but I still do not see the root cause in the latest revision.
https://github.com/apache/maven-surefire/blob/master/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java#L479

Maybe you have older version where is this bug.
So the only thing we can do is to ask you to run the test with
3.0.0-SNAPSHOT.
And then somebody has to debug the code. ;-(

Pls write the test result in JIRA.
If the bug is still present with the snapshot version then I would ask you
to help us, dig in to the code and debug it.

Cheers
Tibor


On Mon, Nov 11, 2019 at 6:33 PM Ryan Thomas <ry...@brainpop.com> wrote:

> Hi Tibor,
>
>
>
> My Company BrainpOP is using Maven 3.6.2 with Junit4.7+ (Junit
> 4.13-beta-3, Junit 4.13-rc-1) and has recently come into an issue while
> trying to optimize flaky test run times.
>
>
>
> We are implementing assumptions to have Tests that are in a bad state to
> be skipped so that they do not add a ton of run time to the Test Suite in a
> case where the next Selenium run command fails with a long
> TimeOutException. However, we have come across some scenarios where
> sometime the Test might fail do to a failed Assertion, and on its next Run
> due to rerunFailingTestCount  criteria being met, an Assumption will fail
> resulting in further runs of the test being skipped. When this occurs, The
> surefire-report-plugin has been failing at parsing the generated XML.
>
>
>
> In analyzing the XML output for the scenario, I found the the XML
> generated was invalid, and that the message tied to where the Assumption
> failed in malformed. In this case, the Tag name (e.g. failure, skipped,
> rerunFailure, etc…) is missing and only the message attribute  and type
> remains. Looking at the surefire-test-report-3.0.xsd Schema, I can see that
> this is invalid.
>
>
>
> Here is the sample Test run in Junit through Maven
>
>
>
> @SuppressWarnings("deprecation")
>
> @Test
>
> public void testSomething3() {
>
>                 System.out.println("the end");
>
>                 i++;
>
>                 if(i == 3)
>
>                                 Assume.assumeTrue("This is a bug", false);
>
>                 else
>
>                                 Assert.assertTrue("Run: " + i,false);
>
> }
>
>
>
> Included here is a sample snippet of the malformed tag from the generated
> XML
>
>
>
> <testcase name="testSomething3" classname="com.brainpop.tests.LoggingTest"
> time="13.289">
>
>     <failure message="Run: 1"
> type="java.lang.AssertionError">java.lang.AssertionError: Run: 1
>
>                 at
> com.brainpop.tests.LoggingTest.testSomething3(LoggingTest.java:66)
>
> </failure>
>
>     <system-out><![CDATA[...]]></system-out>
>
>     <system-err><![CDATA[...]]></system-err>
>
>     <rerunFailure message="Run: 2" type="java.lang.AssertionError">
>
>       <stackTrace>java.lang.AssertionError: Run: 2
>
>                 at
> com.brainpop.tests.LoggingTest.testSomething3(LoggingTest.java:66)
>
> </stackTrace>
>
>       <system-out><![CDATA[...]]></system-out>
>
>       <system-err><![CDATA[...]]></system-err>
>
>     </rerunFailure>
>
>     < message="This is a bug">
>
>       <system-out><![CDATA[...]]></system-out>
>
>       <system-err><![CDATA[...]]></system-err>
>
>     </>
>
>   </testcase>
>
>
>
>
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>

Reply via email to