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

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

    • 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>

          [JENKINS-34777] mstest-plugin durations can overflow test-results-analyzer-plugin

          Stefan Drissen created issue -
          Stefan Drissen made changes -
          Summary Original: mstest-plugin durations can overflow testresult plug-in New: mstest-plugin durations can overflow test-results-analyzer-plugin
          Stefan Drissen made changes -
          Description Original: 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:
          # use a double instead of a float
          # 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>}}

          New: 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:

          {noformat}
                <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)"/>
          {noformat}

          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:
          # use a double instead of a float
          # 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>}}

          Stefan Drissen made changes -
          Description Original: 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:

          {noformat}
                <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)"/>
          {noformat}

          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:
          # use a double instead of a float
          # 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>}}

          New: 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:

          {noformat} <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)"/>{noformat}

          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:
          # use a double instead of a float
          # adjust the xsl to keep the time down:

          {noformat} <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)"/>{noformat}

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

          {noformat}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){noformat}

          Example testsuites.xml file:

          {noformat}<?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>{noformat}
          Stefan Drissen made changes -
          Priority Original: Blocker [ 1 ] New: Trivial [ 5 ]
          Stefan Drissen made changes -
          Resolution New: Cannot Reproduce [ 5 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 170966 ] New: JNJira + In-Review [ 210028 ]

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

              Created:
              Updated:
              Resolved: