[JIRA] [junit-plugin] (JENKINS-34407) junit-plugin parse error

51 views
Skip to first unread message

anf@iisn.de (JIRA)

unread,
Apr 22, 2016, 10:13:02 PM4/22/16
to jenkinsc...@googlegroups.com
André Fügenschuh created an issue
 
Jenkins / Bug JENKINS-34407
junit-plugin parse error
Issue Type: Bug Bug
Assignee: Unassigned
Components: junit-plugin
Created: 2016/Apr/23 2:12 AM
Priority: Major Major
Reporter: André Fügenschuh

Upgrading the junit-plugin from 1.11 to 1.12 fails with a parse error.
I guess this relates to "PR #35" because the skipped (Ignore attr.) test result file's "time" attr. is empty.
While the originator of the file (NUnit) should store a meaningful default (like "00:00:00"), its up to the consumer to provide robust parsing, either by ignoring the "skipped" tests at all or by ignoring the empty string.

// Jenkins log stacktrace
[16:48:06.879] ERROR: Step ‘Publish NUnit test result report’ aborted due to exception:
[16:48:06.879] java.io.IOException: Failed to read C:\Jenkins\workspace\Foo\temporary-junit-reports\TEST-Bar.Common.Test.Utils.AccessorTest_13_2.xml
[16:48:06.879] at hudson.tasks.junit.TestResult.parse(TestResult.java:306)
[16:48:06.879] at hudson.tasks.junit.TestResult.parsePossiblyEmpty(TestResult.java:244)
[16:48:06.879] at hudson.tasks.junit.TestResult.parse(TestResult.java:175)
[16:48:06.879] at hudson.tasks.junit.TestResult.parse(TestResult.java:154)
[16:48:06.879] at hudson.tasks.junit.TestResult.<init>(TestResult.java:126)
[16:48:06.879] at hudson.plugins.nunit.NUnitPublisher$1.invoke(NUnitPublisher.java:243)
[16:48:06.879] at hudson.plugins.nunit.NUnitPublisher$1.invoke(NUnitPublisher.java:226)
[16:48:06.879] at hudson.FilePath.act(FilePath.java:990)
[16:48:06.879] at hudson.FilePath.act(FilePath.java:968)
[16:48:06.879] at hudson.plugins.nunit.NUnitPublisher.getTestResult(NUnitPublisher.java:226)
[16:48:06.879] at hudson.plugins.nunit.NUnitPublisher.recordTestResult(NUnitPublisher.java:189)
[16:48:06.879] at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:152)
[16:48:06.879] at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
[16:48:06.879] at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
[16:48:06.879] at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
[16:48:06.879] at hudson.model.Build$BuildExecution.post2(Build.java:185)
[16:48:06.879] at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
[16:48:06.879] at hudson.model.Run.execute(Run.java:1763)
[16:48:06.879] at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
[16:48:06.879] at hudson.model.ResourceController.execute(ResourceController.java:98)
[16:48:06.879] at hudson.model.Executor.run(Executor.java:410)
[16:48:06.879] Caused by: java.lang.NumberFormatException: empty String
[16:48:06.879] at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
[16:48:06.879] at sun.misc.FloatingDecimal.parseFloat(Unknown Source)
[16:48:06.879] at java.lang.Float.parseFloat(Unknown Source)
[16:48:06.879] at hudson.tasks.junit.SuiteResult.<init>(SuiteResult.java:170)
[16:48:06.879] at hudson.tasks.junit.SuiteResult.parseSuite(SuiteResult.java:144)
[16:48:06.879] at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:129)
[16:48:06.879] at hudson.tasks.junit.TestResult.parse(TestResult.java:301)
[16:48:06.879] ... 20 more

// UnitTest.result file
<?xml version="1.0" encoding="UTF-8"?><testsuite errors="0" failures="0" name="Foo.Common.Test.Utils.AccessorTest" skipped="1" tests="1" time="">
<testcase classname="Foo.Common.Test.Utils.AccessorTest" name="InternalStaticMethod_DirectAccess()">
<skipped message="Assembly containing class to access is not the use case."/>
</testcase>
</testsuite>

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

rpz@otit.fi (JIRA)

unread,
Apr 25, 2016, 5:30:01 AM4/25/16
to jenkinsc...@googlegroups.com
Risto Oikarinen commented on Bug JENKINS-34407
 
Re: junit-plugin parse error

I'm also seeing this with 1.12:

Caused by: java.lang.NumberFormatException: For input string: "1,152.814"
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
at sun.misc.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
at java.lang.Float.parseFloat(Float.java:451)


at hudson.tasks.junit.SuiteResult.<init>(SuiteResult.java:170)

martin.wegner@ebp.de (JIRA)

unread,
Apr 26, 2016, 9:16:02 AM4/26/16
to jenkinsc...@googlegroups.com
Martin Wegner commented on Bug JENKINS-34407
 
Re: junit-plugin parse error

Same problem here:

Tests run: 54, Failures: 1, Errors: 0, Skipped: 3

[ERROR] There are test failures.

Please refer to C:\Jenkins\workspace\bla\target\surefire-reports for the individual test results.
[JENKINS] Recording test results
java.io.IOException: Failed to read C:\Jenkins\workspace\bla\target\surefire-reports\TEST-bla.test.TestBlub.xml
	at hudson.tasks.junit.TestResult.parse(TestResult.java:306)
	at hudson.tasks.junit.TestResult.parsePossiblyEmpty(TestResult.java:244)
	at hudson.tasks.junit.TestResult.parse(TestResult.java:213)
	at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:148)
	at hudson.maven.Maven3Builder$MavenExecutionListener.recordMojoEnded(Maven3Builder.java:634)
	at hudson.maven.Maven3Builder$MavenExecutionListener.mojoSucceeded(Maven3Builder.java:615)
	at hudson.maven.Maven3Builder$JenkinsEventSpy.onEvent(Maven3Builder.java:308)
	at org.apache.maven.eventspy.internal.EventSpyDispatcher.onEvent(EventSpyDispatcher.java:108)
	at org.apache.maven.eventspy.internal.EventSpyExecutionListener.mojoSucceeded(EventSpyExecutionListener.java:131)
	at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:87)
	at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:42)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:227)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.jvnet.hudson.maven3.launcher.Maven32Launcher.main(Maven32Launcher.java:132)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
	at jenkins.maven3.agent.Maven32Main.launch(Maven32Main.java:186)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:136)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
	at hudson.remoting.UserRequest.perform(UserRequest.java:120)
	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
	at hudson.remoting.Request$2.run(Request.java:332)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NumberFormatException: For input string: "4,725.993"
	at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
	at sun.misc.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
	at java.lang.Float.parseFloat(Float
.java:451)
	at hudson.tasks.junit.SuiteResult.<init>(SuiteResult.java:170)
	at hudson.tasks.junit.SuiteResult.parseSuite(SuiteResult.java:144)
	at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:129)
	at hudson.tasks.junit.TestResult.parse(TestResult.java:301)
	... 42 more

crussell52@gmail.com (JIRA)

unread,
Apr 27, 2016, 1:07:01 PM4/27/16
to jenkinsc...@googlegroups.com
Chris Russell commented on Bug JENKINS-34407
 
Re: junit-plugin parse error

Jenkins: 2.0
Java: jdk1.8.0_45

The same is occurring for me in cases of long-running jobs. This does not occur after downgrading to version 1.11 of the plugin.

It looks like the root cause was likely identified here: https://github.com/jenkinsci/junit-plugin/commit/dabb301a90215849123437c61a9027ef2bd76703#diff-c17f918d04dfda506bcad39a3b390b26

crussell52@gmail.com (JIRA)

unread,
Apr 27, 2016, 1:08:01 PM4/27/16
to jenkinsc...@googlegroups.com
Chris Russell edited a comment on Bug JENKINS-34407
 
Re: junit-plugin parse error
Jenkins: 2.0
Java: jdk1.8.0_45
 
, jdk1.7.0_79

The same is occurring for me in cases of long-running jobs. This does not occur after downgrading to version 1.11 of the plugin. 

It looks like the root cause was likely identified here: https://github.com/jenkinsci/junit-plugin/commit/dabb301a90215849123437c61a9027ef2bd76703#diff-c17f918d04dfda506bcad39a3b390b26

anf@iisn.de (JIRA)

unread,
Apr 27, 2016, 1:24:03 PM4/27/16
to jenkinsc...@googlegroups.com
André Fügenschuh commented on Bug JENKINS-34407
 
Re: junit-plugin parse error

All comments following my OP are related to the fact that the parsing is not L10N capable. While its a good idea that the originator should not store a localized formatted number, the consumer could parse with a localized NumberFormat instance.

anf@iisn.de (JIRA)

unread,
Apr 27, 2016, 8:05:02 PM4/27/16
to jenkinsc...@googlegroups.com
André Fügenschuh updated an issue
Change By: André Fügenschuh
Upgrading the junit-plugin from 1.11 to 1.12 fails with a parse error.
I guess this relates to "PR #35" because the *skipped* (Ignore attr.) test result file's "time" attr. is *empty*.
While the originator of the file (NUnit) should store a meaningful default (like
 -  "00:00:00" - "0.0" ), its up to the consumer to provide robust parsing, either by ignoring the "skipped" tests at all or by ignoring the empty string.


// Jenkins log stacktrace
\[16:48:06.879\] ERROR: Step ‘Publish NUnit test result report’ aborted due to exception: 
\[16:48:06.879\] java.io.IOException: Failed to read C:\Jenkins\workspace\Foo\temporary-junit-reports\TEST-Bar.Common.Test.Utils.AccessorTest_13_2.xml
\[16:48:06.879\]  at hudson.tasks.junit.SuiteResult.<init>(SuiteResult.java:170)
\[16:48:06.879\]  at hudson.tasks.junit.SuiteResult.parseSuite(SuiteResult.java:144)

\[16:48:06.879\]  at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:129)
\[16:48:06.879\]  at hudson.tasks.junit.TestResult.parse(TestResult.java:301)
\[16:48:06.879\]  ... 20 more

// UnitTest.result file
<?xml version="1.0" encoding="UTF-8"?><testsuite errors="0" failures="0" name="Foo.Common.Test.Utils.AccessorTest" skipped="1" tests="1" time="">
<testcase classname="Foo.Common.Test.Utils.AccessorTest" name="InternalStaticMethod_DirectAccess()">
<skipped message="Assembly containing class to access is not the use case."/>
</testcase>
</testsuite>

scm_issue_link@java.net (JIRA)

unread,
Apr 30, 2016, 3:42:03 AM4/30/16
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon commented on Bug JENKINS-34407
 
Re: junit-plugin parse error

Code changed in jenkins
User: Oliver Gondža
Path:
src/main/java/hudson/tasks/junit/CaseResult.java
src/main/java/hudson/tasks/junit/SuiteResult.java
src/main/java/hudson/tasks/junit/TimeToFloat.java
src/test/java/hudson/tasks/junit/SuiteResultTest.java
src/test/resources/hudson/tasks/junit/junit-report-testsuite-time-attrs.xml
http://jenkins-ci.org/commit/junit-plugin/e09cdd41a020533af124be8bd8baaba3d9a3f1df
Log:
Merge pull request #43 from jenkinsci/parse-time-in-suiteresult

[FIXED JENKINS-34407] Parse time correctly in SuiteResult.

Compare: https://github.com/jenkinsci/junit-plugin/compare/2952d092b9d7...e09cdd41a020

scm_issue_link@java.net (JIRA)

unread,
Apr 30, 2016, 3:42:03 AM4/30/16
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon resolved as Fixed
Change By: SCM/JIRA link daemon
Status: Open Resolved
Resolution: Fixed

ogondza@gmail.com (JIRA)

unread,
May 1, 2016, 12:54:04 AM5/1/16
to jenkinsc...@googlegroups.com
Oliver Gondža commented on Bug JENKINS-34407
 
Re: junit-plugin parse error

Pushed 1.13 with the fix.

george@fischhof.hu (JIRA)

unread,
Aug 22, 2016, 4:11:02 AM8/22/16
to jenkinsc...@googlegroups.com
George Fischhof reopened an issue
 

I have the same issue with JUnit plugin version 1.18, Jenkins 2.18, on windows 8.1 x64, JAVA_VERSION="1.8.0_91"

stack trace:

at hudson.tasks.junit.TestResult.parse(TestResult.java:306)
at hudson.tasks.junit.TestResult.parsePossiblyEmpty(TestResult.java:244)

at hudson.tasks.junit.TestResult.parse(TestResult.java:175)
at hudson.tasks.junit.TestResult.parse(TestResult.java:154)


at hudson.tasks.junit.TestResult.<init>(TestResult.java:126)

at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:132)
at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:107)
at hudson.FilePath.act(FilePath.java:1018)
at hudson.FilePath.act(FilePath.java:996)
at hudson.tasks.junit.JUnitParser.parseResult(JUnitParser.java:103)
at hudson.tasks.junit.JUnitResultArchiver.parse(JUnitResultArchiver.java:128)
at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:149)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
at hudson.model.Run.execute(Run.java:1745)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: java.lang.NullPointerException
at hudson.tasks.junit.CaseResult.<init>(CaseResult.java:116)
at hudson.tasks.junit.SuiteResult.<init>(SuiteResult.java:200)


at hudson.tasks.junit.SuiteResult.parseSuite(SuiteResult.java:144)
at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:129)
at hudson.tasks.junit.TestResult.parse(TestResult.java:301)

... 21 more

Change By: George Fischhof
Resolution: Fixed
Status: Resolved Reopened
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

ogondza@gmail.com (JIRA)

unread,
Aug 22, 2016, 4:20:02 AM8/22/16
to jenkinsc...@googlegroups.com
 
Re: junit-plugin parse error

George Fischhof, That stacktrace is unrelated to this issue. Please file a separate one if it is not already.

george@fischhof.hu (JIRA)

unread,
Aug 22, 2016, 5:25:01 AM8/22/16
to jenkinsc...@googlegroups.com
George Fischhof assigned an issue to George Fischhof
 

The error was my mistake: accidentally I put an attribute to node in the xml file.
When I fixed the xml, the parsing was good

Sorry guys.

Change By: George Fischhof
Assignee: George Fischhof

george@fischhof.hu (JIRA)

unread,
Aug 22, 2016, 5:27:02 AM8/22/16
to jenkinsc...@googlegroups.com
George Fischhof assigned an issue to Unassigned
 

please close this issue, it is good in 1.18

george@fischhof.hu (JIRA)

unread,
Aug 22, 2016, 5:28:07 AM8/22/16
to jenkinsc...@googlegroups.com
George Fischhof resolved as Fixed
 

the issue I reported against 1.18 was my mistake (I used a wrong xml file)

Change By: George Fischhof
Status: Reopened Resolved
Resolution: Fixed
Reply all
Reply to author
Forward
0 new messages