[JIRA] [mstest-plugin] (JENKINS-34777) mstest-plugin durations can overflow testresult plug-in

1 view
Skip to first unread message

stefan.drissen@gmail.com (JIRA)

unread,
May 12, 2016, 4:57:01 PM5/12/16
to jenkinsc...@googlegroups.com
Stefan Drissen created an issue
 
Jenkins / Bug JENKINS-34777
mstest-plugin durations can overflow testresult plug-in
Issue Type: Bug Bug
Assignee: Ivo Bellin Salarin
Components: mstest-plugin, test-results-analyzer-plugin
Created: 2016/May/12 8:56 PM
Environment: Windows 8.1 x64
Jenkins 1.630
mstest-plugin 0.19
test-results-analyzer-plugin 0.3.4
Priority: Blocker Blocker
Reporter: Stefan Drissen

Note: all of the below has not been verified, currently waiting for a free node to test the simple test case.

Too many digits are used as duration.

src/main/resources/hudson/plugins/mstest/mstest-to-junit.xsl is taking the entire duration from the trx and putting it in the JUnit time:

{{ <xsl:variable name="duration_seconds" select="substring($duration, 7)"/>
<xsl:variable name="duration_minutes" select="substring($duration, 4, 2 )"/>
<xsl:variable name="duration_hours" select="substring($duration, 1, 2)"/>}}

However, the totalTimeTaken is 'only' a float and net.sf.json.JSONUtils.testValidity throws a "JSON does not allow non-finite numbers" when the value is too large for a float. Since a float can only have 6-8 digits the duration above fails.

So either:

  1. use a double instead of a float
  2. adjust the xsl to keep the time down:

{{ <xsl:variable name="duration_seconds" select="substring($duration, 7, 4)"/>
<xsl:variable name="duration_minutes" select="substring($duration, 4, 2 )"/>
<xsl:variable name="duration_hours" select="substring($duration, 1, 2)"/>}}

When starting the test results analyzer, Jenkins sytem log contains:

{{May 12, 2016 9:52:02 PM WARNING org.kohsuke.stapler.HttpResponseRenderer$Default handleJavaScriptProxyMethodCall
call to /$stapler/bound/37513732-3136-4970-86bb-052ba76502ab/getTreeResult failed
net.sf.json.JSONException: JSON does not allow non-finite numbers.
at net.sf.json.util.JSONUtils.testValidity(JSONUtils.java:629)
at net.sf.json.AbstractJSON._processValue(AbstractJSON.java:245)
at net.sf.json.JSONObject._processValue(JSONObject.java:2599)
at net.sf.json.JSONObject.processValue(JSONObject.java:2665)
at net.sf.json.JSONObject.element(JSONObject.java:1738)
at net.sf.json.JSONObject.element(JSONObject.java:1716)
at net.sf.json.JSONObject.put(JSONObject.java:2328)
at org.jenkinsci.plugins.testresultsanalyzer.result.data.ResultData.getJsonObject(ResultData.java:171)
at org.jenkinsci.plugins.testresultsanalyzer.result.info.Info.getBuildJson(Info.java:41)
at org.jenkinsci.plugins.testresultsanalyzer.result.info.Info.getJsonObject(Info.java:57)
at org.jenkinsci.plugins.testresultsanalyzer.result.info.ResultInfo.getJsonObject(ResultInfo.java:31)
at org.jenkinsci.plugins.testresultsanalyzer.JsTreeUtil.getJsTree(JsTreeUtil.java:21)
at org.jenkinsci.plugins.testresultsanalyzer.TestResultsAnalyzerAction.getTreeResult(TestResultsAnalyzerAction.java:177)}}

Example testsuites.xml file:

{{<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="MSTestSuite" tests="1" time="0" failures="4" errors="0" skipped="0">
<testcase name="overflow" time="95.1412296" classname="overflow"/>
</testsuite>
</testsuites>}}

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages