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

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

    Details

    • Similar Issues:

      Description

      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>

        Attachments

          Activity

          Hide
          smd Stefan Drissen added a comment -

          Simple test case is not triggering the JSONException - lowered status to trivial while digging deeper.

          Show
          smd Stefan Drissen added a comment - Simple test case is not triggering the JSONException - lowered status to trivial while digging deeper.
          Hide
          smd Stefan Drissen added a comment -

          After cleaning up some old build data the issue went away - not sure what exactly was triggering the issue, so can be closed.

          Show
          smd Stefan Drissen added a comment - After cleaning up some old build data the issue went away - not sure what exactly was triggering the issue, so can be closed.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: