Repository navigation
[JENKINS-1317] Null Pointer Exception parsing JUnit results #787
Description
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 :
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 :
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
jenkins-infra-bot commentedon Feb 28, 2008
dwdyer:
Raw content of original comment:
Fixed for release 1.186.
jenkins-infra-bot commentedon Feb 28, 2008
dwdyer:
Raw content of original comment:
jenkins-infra-bot commentedon Nov 26, 2025
[Original
is_duplicated_byfrom Jira: JENKINS-1312]