Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-11717

TestNG publisher plugin throws NullPointerException when trying to publish testng results and makes build to fail

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: testng-plugin
    • Environment:
      Linux 2.6.18-274.3.1.el5 #1 SMP Tue Sep 6 20:13:52 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
    • Similar Issues:

      Description

      Looking for TestNG results report in workspace using pattern: */.xml
      ERROR: Publisher hudson.plugins.testng.Publisher aborted due to exception
      java.lang.NullPointerException
      at hudson.plugins.testng.parser.ResultsParser.finishSuite(ResultsParser.java:267)
      at hudson.plugins.testng.parser.ResultsParser.parse(ResultsParser.java:166)
      at hudson.plugins.testng.TestNGBuildAction.loadResults(TestNGBuildAction.java:105)
      at hudson.plugins.testng.Publisher.perform(Publisher.java:103)
      at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:27)
      at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:694)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:669)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:647)
      at hudson.model.Build$RunnerImpl.post2(Build.java:162)
      at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:616)
      at hudson.model.Run.run(Run.java:1429)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:230)

      I have other jobs that are configured in the same way (cloned the failing one) and these jobs are not failing (no exception is thrown).

        Attachments

          Activity

          Hide
          dumghen Ghenadie Dumitru added a comment -

          No groups are defined in suite file, only suite, and test sets with classes and parameters.

          Show
          dumghen Ghenadie Dumitru added a comment - No groups are defined in suite file, only suite, and test sets with classes and parameters.
          Hide
          nalin_makar nalin_makar added a comment -

          Can you check that testng-results.xml file is generated as part of running the tests? If it's generated, please attached that file.

          Show
          nalin_makar nalin_makar added a comment - Can you check that testng-results.xml file is generated as part of running the tests? If it's generated, please attached that file.
          Hide
          dumghen Ghenadie Dumitru added a comment -

          I found the problem:

          When trying to read testng-results.xml in browser I get error:

          error on line 1330 at column 24: Input is not proper UTF-8, indicate encoding !
          Bytes: 0x01 0x0D 0x0A 0x2C

          It is something like the link below except that I don't have some Cyrillic/others strange characters but there are non-alpha-numeric characters (0x01) in one CDATA section :

          http://jira.opensymphony.com/browse/TESTNG-209

          ------
          <exception class="java.lang.AssertionError">
          <message>
          <![CDATA[Error, timestamp: 1321457461047 text: raw (0x01)]]>

          Show
          dumghen Ghenadie Dumitru added a comment - I found the problem: When trying to read testng-results.xml in browser I get error: error on line 1330 at column 24: Input is not proper UTF-8, indicate encoding ! Bytes: 0x01 0x0D 0x0A 0x2C It is something like the link below except that I don't have some Cyrillic/others strange characters but there are non-alpha-numeric characters (0x01) in one CDATA section : http://jira.opensymphony.com/browse/TESTNG-209 ------ <exception class="java.lang.AssertionError"> <message> <![CDATA [Error, timestamp: 1321457461047 text: raw (0x01)] ]>
          Hide
          nalin_makar nalin_makar added a comment -

          Ghenadie,

          Thanks for debugging this further. Seems like it's an issue with TestNG's reporter itself which is not creating proper xml files.

          Can you possibly attach the testng.xml and a sample code that could generate such an XML? I can then work on fixing the TestNG's XML reporter.

          Show
          nalin_makar nalin_makar added a comment - Ghenadie, Thanks for debugging this further. Seems like it's an issue with TestNG's reporter itself which is not creating proper xml files. Can you possibly attach the testng.xml and a sample code that could generate such an XML? I can then work on fixing the TestNG's XML reporter.
          Hide
          dumghen Ghenadie Dumitru added a comment -

          Thi is testng-results.xml file

          Show
          dumghen Ghenadie Dumitru added a comment - Thi is testng-results.xml file
          Hide
          dumghen Ghenadie Dumitru added a comment -

          My code:

          @Test
          public void generateRawData()

          { Reporter.log("Log This: \u0001"); }
          Show
          dumghen Ghenadie Dumitru added a comment - My code: @Test public void generateRawData() { Reporter.log("Log This: \u0001"); }
          Hide
          nalin_makar nalin_makar added a comment -

          Ghenadie,

          This is an issue with how TestNG is generating the XMLs because the XMLs themselves have an issue. I'll only be able to fix this bug to show some error instead of resulting in an NPE.

          Show
          nalin_makar nalin_makar added a comment - Ghenadie, This is an issue with how TestNG is generating the XMLs because the XMLs themselves have an issue. I'll only be able to fix this bug to show some error instead of resulting in an NPE.
          Hide
          nalin_makar nalin_makar added a comment -

          I have fixed a possible NPE issue. If you see this stacktrace again, please reopen this bug.

          Fix will be out in v0.30.

          Show
          nalin_makar nalin_makar added a comment - I have fixed a possible NPE issue. If you see this stacktrace again, please reopen this bug. Fix will be out in v0.30.

            People

            • Assignee:
              nalin_makar nalin_makar
              Reporter:
              dumghen Ghenadie Dumitru
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: