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

BlueOcean API parallel node duration in ms incorrect in declarative pipeline

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • blueocean-plugin
    • None
    • Jenkins: CloudBees Jenkins Enterprise 2.46.24.0.2-fixed
      Pipeline - Declarative: 1.2.4
      Blue Ocean: 1.3.3

      When moving our pipeline from scripted to declarative, we've noticed that the node duration in milliseconds returned by the blue ocean rest API appears to be incorrect for parallel stages. It seems it may be reporting just the time to start the stage rather than the total duration.

      Example pipeline:

      pipeline {
        agent any
        stages {
          stage('parallel sleep') {
            parallel {
              stage('1') {
                steps {
                  sleep time: 1, unit: 'MINUTES'
                }
              }
              stage('2') {
                steps {
                  sleep time: 1, unit: 'MINUTES'
                }
              }
            }
          }
        }
      }
      

      Blue Ocean API (/blue/rest/blueocean-api-bug-test/runs/2/nodes/) returns:

      <snip>
        "displayName": "1",
        "durationInMillis": 171,
        "id": "9",
        "input": null,
        "result": "SUCCESS",
        "startTime": "2018-01-09T09:13:18.778+0000",
        "state": "FINISHED",
      <snip>

      Compared to an example in scripted:

      node('m1.medium') {
        stage('parallel sleep') {
          parallel([
            '1': {
              sleep time: 1, unit: 'MINUTES'
            },
            '2': {
              sleep time: 1, unit: 'MINUTES'
            },
          ])
        }
      }

      Blue Ocean API (/blue/rest/blueocean-api-bug-test/runs/3/nodes/) returns:

      <snip>
        "displayName": "1",
        "durationInMillis": 60274,
        "id": "9",
        "input": null,
        "result": "SUCCESS",
        "startTime": "2018-01-09T09:53:00.085+0000",
        "state": "FINISHED",
      <snip>

      It feels like a bug to me. If not a bug, then it feels like an inconsistency in behaviour unless I have done something horribly wrong in my implementation (likely! )

            Unassigned Unassigned
            rjbwtr Richard Bowater
            Votes:
            6 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: