testng-team / testng-team/testng

Verbose mode > 4 can crash with Maven failsafe

Open
#1,069 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: reporting effort: medium priority: medium runner: maven status: needs reproducer triage: ai-reviewed type: bug
Dominant language
Java
Stars
2.1k
Forks
1k
Avg merge
2d 35m
Merged PRs (30d)
81

Description

This is weired.
When running TestNG + Maven failesafe, with surefire.testng.verbose > 4:

<configuration>
    <suiteXmlFiles>
        <suiteXmlFile>My_Test_Suite.xml</suiteXmlFile>
    </suiteXmlFiles>
    <systemPropertyVariables>

        <surefire.security.manager>java.lang.SecurityManager</surefire.security.manager>
        <java.security.manager>default</java.security.manager>
    </systemPropertyVariables>

    <useSystemClassloader>false</useSystemClassloader>
    <threadCount>20</threadCount>
    <reuseForks>true</reuseForks>
    <argLine>-Xmx2048m</argLine>
    <properties>
        <property>
            <name>listener</name>
            <value>org.imaginea.jenkins.plugins.testinprogress.testng.TestNGProgressRunListener</value>
        </property>
        <property>
            <name>surefire.testng.verbose</name>
            <value>10</value>
        </property>
    </properties>
</configuration>

On Windows 2008 R2, all tests fail right away.
If I change it to Verbose < 5, everything run as usual.

I'm not sure if the following exception is the cause:

Creating c:\jenkins-slave\workspace\Automation_Matrix_New\72b9012b\test-output\testng-failed.xml
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:1012)
at org.testng.internal.Utils.writeFile(Utils.java:173)
at org.testng.internal.Utils.writeUtf8File(Utils.java:135)
at org.testng.reporters.FailedReporter.generateFailureSuite(FailedReporter.java:76)
at org.testng.reporters.FailedReporter.generateReport(FailedReporter.java:47)
at org.testng.TestNG.generateReports(TestNG.java:1135)
at org.testng.TestNG.run(TestNG.java:1081)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:281)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:121)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Maven Failsafe run on Windows with surefire.testng.verbose set to 10, then compare it with a value below 5. Start with org.testng.internal.Utils.writeFile and FailedReporter.generateFailureSuite, following the call path from TestNG.generateReports; done means the high-verbosity run no longer fails with the reported Windows filename error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.