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

mstest-plugin durations can overflow test-results-analyzer-plugin

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Trivial Trivial
    • None
    • Windows 8.1 x64
      Jenkins 1.630
      mstest-plugin 0.19
      test-results-analyzer-plugin 0.3.4

      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>

            nilleb Ivo Bellin Salarin
            smd Stefan Drissen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: