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

"durationMillis" is always 0 at wfapi/describe json

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      "durationMillis" is always 0 when I use http://master1.localhost.local:8080/job/pipeline/1/wfapi/

      Pipeline script

      echo 'hello guys'
      stage 'one'
      node {
          sh 'sleep 5'
      }
      stage 'two'
      node {
          sh 'sleep 5'
      }
      stage 'three'
      echo 'we are going to crash....'
      //throw new Exception("crash!!!")
      sleep 2
      

      Two builds, the first one fails and the second goes well.

      http://master1.localhost.local:8080/job/pipeline/1/wfapi/

      {"_links":{"self":{"href":"/job/pipeline/1/wfapi/describe"}},"id":"1","name":"#1","status":"FAILED","startTimeMillis":1479827355259,"endTimeMillis":0,"durationMillis":0,"queueDurationMillis":688,"pauseDurationMillis":0,"stages":[{"_links":{"self":{"href":"/job/pipeline/1/execution/node/4/wfapi/describe"}},"id":"4","name":"one","execNode":"","status":"SUCCESS","startTimeMillis":1479827355947,"durationMillis":5703,"pauseDurationMillis":0},{"_links":{"self":{"href":"/job/pipeline/1/execution/node/10/wfapi/describe"}},"id":"10","name":"two","execNode":"","status":"SUCCESS","startTimeMillis":1479827361650,"durationMillis":5522,"pauseDurationMillis":0},{"_links":{"self":{"href":"/job/pipeline/1/execution/node/16/wfapi/describe"}},"id":"16","name":"three","execNode":"","status":"FAILED","error":{"message":"Scripts not permitted to use new java.lang.Exception java.lang.String","type":"org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException"},"startTimeMillis":1479827367172,"durationMillis":71,"pauseDurationMillis":0}]}
      

      http://master1.localhost.local:8080/job/pipeline/2/wfapi/

      {"_links":{"self":{"href":"/job/pipeline/2/wfapi/describe"}},"id":"2","name":"#2","status":"SUCCESS","startTimeMillis":1479827535687,"endTimeMillis":0,"durationMillis":0,"queueDurationMillis":49,"pauseDurationMillis":0,"stages":[{"_links":{"self":{"href":"/job/pipeline/2/execution/node/4/wfapi/describe"}},"id":"4","name":"one","execNode":"","status":"SUCCESS","startTimeMillis":1479827535736,"durationMillis":5520,"pauseDurationMillis":0},{"_links":{"self":{"href":"/job/pipeline/2/execution/node/10/wfapi/describe"}},"id":"10","name":"two","execNode":"","status":"SUCCESS","startTimeMillis":1479827541256,"durationMillis":5514,"pauseDurationMillis":0},{"_links":{"self":{"href":"/job/pipeline/2/execution/node/16/wfapi/describe"}},"id":"16","name":"three","execNode":"","status":"SUCCESS","startTimeMillis":1479827546770,"durationMillis":2027,"pauseDurationMillis":0}]}
      

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Sam Van Oort
          Path:
          rest-api/src/test/java/com/cloudbees/workflow/rest/endpoints/JobAndRunAPITest.java
          http://jenkins-ci.org/commit/pipeline-stage-view-plugin/2210a8e899053312fe3b1f6011dc8e991586faa2
          Log:
          Test case for zero-duration run JENKINS-40162

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Sam Van Oort Path: rest-api/src/test/java/com/cloudbees/workflow/rest/endpoints/JobAndRunAPITest.java http://jenkins-ci.org/commit/pipeline-stage-view-plugin/2210a8e899053312fe3b1f6011dc8e991586faa2 Log: Test case for zero-duration run JENKINS-40162
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Sam Van Oort
          Path:
          rest-api/src/main/java/com/cloudbees/workflow/flownode/FlowNodeUtil.java
          rest-api/src/main/java/com/cloudbees/workflow/rest/endpoints/JobAPI.java
          rest-api/src/main/java/com/cloudbees/workflow/rest/endpoints/flownode/Describe.java
          rest-api/src/main/java/com/cloudbees/workflow/rest/external/RunExt.java
          rest-api/src/main/java/com/cloudbees/workflow/rest/hal/Link.java
          rest-api/src/main/java/com/cloudbees/workflow/rest/hal/Links.java
          rest-api/src/test/java/com/cloudbees/workflow/rest/endpoints/JobAndRunAPITest.java
          rest-api/src/test/java/com/cloudbees/workflow/rest/endpoints/UndefinedWorkflowTest.java
          http://jenkins-ci.org/commit/pipeline-stage-view-plugin/c75efd27a1490195deb5ecab25a7965dca95be99
          Log:
          Merge pull request #44 from jenkinsci/fix-run-timing-bug-JENKINS-40162

          Fix run timing bug for runs JENKINS-40162

          Compare: https://github.com/jenkinsci/pipeline-stage-view-plugin/compare/6a302ebeea8d...c75efd27a149

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Sam Van Oort Path: rest-api/src/main/java/com/cloudbees/workflow/flownode/FlowNodeUtil.java rest-api/src/main/java/com/cloudbees/workflow/rest/endpoints/JobAPI.java rest-api/src/main/java/com/cloudbees/workflow/rest/endpoints/flownode/Describe.java rest-api/src/main/java/com/cloudbees/workflow/rest/external/RunExt.java rest-api/src/main/java/com/cloudbees/workflow/rest/hal/Link.java rest-api/src/main/java/com/cloudbees/workflow/rest/hal/Links.java rest-api/src/test/java/com/cloudbees/workflow/rest/endpoints/JobAndRunAPITest.java rest-api/src/test/java/com/cloudbees/workflow/rest/endpoints/UndefinedWorkflowTest.java http://jenkins-ci.org/commit/pipeline-stage-view-plugin/c75efd27a1490195deb5ecab25a7965dca95be99 Log: Merge pull request #44 from jenkinsci/fix-run-timing-bug- JENKINS-40162 Fix run timing bug for runs JENKINS-40162 Compare: https://github.com/jenkinsci/pipeline-stage-view-plugin/compare/6a302ebeea8d...c75efd27a149
          Hide
          svanoort Sam Van Oort added a comment -

          Fix released with v2.9

          Show
          svanoort Sam Van Oort added a comment - Fix released with v2.9

            People

            • Assignee:
              svanoort Sam Van Oort
              Reporter:
              escoem Emilio Escobar
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: