Skip to content

[JENKINS-1317] Null Pointer Exception parsing JUnit results #787

Closed

Description

@jenkins-infra-bot

Hi,
first of all thanks for the very good job you are making: your tool is really
grateful.
I think I found a bug related to Junit test result parsing.

In same cases we are getting a:

FATAL: Failed to read
/home/dstk110/build/hudson/jobs/DSTK-All-Linux-release/workspace/dstk/report/xml-out/TEST-com.primeur.dstk.datamanager.test.DSTSPTest.xml
hudson.util.IOException2: Failed to read
/home/dstk110/build/hudson/jobs/DSTK-All-Linux-release/workspace/dstk/report/xml-out/TEST-com.primeur.dstk.datamanager.test.DSTSPTest.xml
at hudson.tasks.junit.TestResult.parse(TestResult.java:128)
at hudson.tasks.junit.TestResult.parse(TestResult.java:95)
at hudson.tasks.junit.TestResult.(TestResult.java:72)
at hudson.tasks.junit.JUnitResultArchiver$1.invoke(JUnitResultArchiver.java:62)
at hudson.tasks.junit.JUnitResultArchiver$1.invoke(JUnitResultArchiver.java:51)
at hudson.FilePath.act(FilePath.java:301)
at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:51)
at
hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:273)
at
hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:261)
at hudson.model.Build$RunnerImpl.post2(Build.java:136)
at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:246)
at hudson.model.Run.run(Run.java:677)
at hudson.model.Build.run(Build.java:101)
at hudson.model.ResourceController.execute(ResourceController.java:70)
at hudson.model.Executor.run(Executor.java:65)
Caused by: java.lang.NullPointerException
at hudson.tasks.junit.CaseResult.parseTime(CaseResult.java:47)
at hudson.tasks.junit.CaseResult.(CaseResult.java:34)
at hudson.tasks.junit.CaseResult.(CaseResult.java:42)
at hudson.tasks.junit.SuiteResult.(SuiteResult.java:69)
at hudson.tasks.junit.TestResult.parse(TestResult.java:124)
... 14 more

After having had a look at the source code :

http://fisheye5.cenqua.com/browse/hudson/hudson/main/core/src/main/java/hudson/tasks/junit/CaseResult.java#r1.13

at line 48 there is a check if(time=!null).
In some of our test, we have seen that the time attribute is not set.

Is it possible to move the line

time = time.replace(",","");

inside the check so that if the time attribute is not present it does not break
the build?

Thanks in advance,
Fulvio


Originally reported by f_cavarretta, imported from: Null Pointer Exception parsing JUnit results
  • status: Closed
  • priority: Critical
  • component(s): junit-plugin
  • resolution: Fixed
  • resolved: 2008-02-28T15:20:16+00:00
  • votes: 0
  • watchers: 1
  • imported: 2025-11-26
Raw content of original issue

Hi, first of all thanks for the very good job you are making: your tool is really grateful. I think I found a bug related to Junit test result parsing.

In same cases we are getting a:

FATAL: Failed to read /home/dstk110/build/hudson/jobs/DSTK-All-Linux-release/workspace/dstk/report/xml-out/TEST-com.primeur.dstk.datamanager.test.DSTSPTest.xml hudson.util.IOException2: Failed to read /home/dstk110/build/hudson/jobs/DSTK-All-Linux-release/workspace/dstk/report/xml-out/TEST-com.primeur.dstk.datamanager.test.DSTSPTest.xml at hudson.tasks.junit.TestResult.parse(TestResult.java:128) at hudson.tasks.junit.TestResult.parse(TestResult.java:95) at hudson.tasks.junit.TestResult.<init>(TestResult.java:72) at hudson.tasks.junit.JUnitResultArchiver$1.invoke(JUnitResultArchiver.java:62) at hudson.tasks.junit.JUnitResultArchiver$1.invoke(JUnitResultArchiver.java:51) at hudson.FilePath.act(FilePath.java:301) at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:51) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:273) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:261) at hudson.model.Build$RunnerImpl.post2(Build.java:136) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:246) at hudson.model.Run.run(Run.java:677) at hudson.model.Build.run(Build.java:101) at hudson.model.ResourceController.execute(ResourceController.java:70) at hudson.model.Executor.run(Executor.java:65) Caused by: java.lang.NullPointerException at hudson.tasks.junit.CaseResult.parseTime(CaseResult.java:47) at hudson.tasks.junit.CaseResult.<init>(CaseResult.java:34) at hudson.tasks.junit.CaseResult.<init>(CaseResult.java:42) at hudson.tasks.junit.SuiteResult.<init>(SuiteResult.java:69) at hudson.tasks.junit.TestResult.parse(TestResult.java:124) ... 14 more

After having had a look at the source code :

http://fisheye5.cenqua.com/browse/hudson/hudson/main/core/src/main/java/hudson/tasks/junit/CaseResult.java#r1.13

at line 48 there is a check if(time=!null). In some of our test, we have seen that the time attribute is not set.

Is it possible to move the line

time = time.replace(",","");

inside the check so that if the time attribute is not present it does not break the build?

Thanks in advance, Fulvio

  • environment: Platform: All, OS: Linux

Activity

  1. jenkins-infra-bot commented on Feb 28, 2008

    @jenkins-infra-bot
    Author
    dwdyer:
    • Original comment link
    • Raw content of original comment:

      Fixed for release 1.186.

    Fixed for release 1.186.

  2. jenkins-infra-bot commented on Feb 28, 2008

    @jenkins-infra-bot
    Author
    dwdyer:
    • Original comment link
    • Raw content of original comment:
          • Issue 1312 has been marked as a duplicate of this issue. ***
        • Issue 1312 has been marked as a duplicate of this issue. ***
  3. jenkins-infra-bot commented on Nov 26, 2025

    @jenkins-infra-bot
    Author

    [Original is_duplicated_by from Jira: JENKINS-1312]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions