jenkinsci / jenkinsci/blueocean-plugin

[JENKINS-48859] BlueOcean API parallel node duration in ms incorrect in declarative pipeline

Open
#4,635 5 comments 0 reactions 0 assignees View on GitHub
component:blueocean-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
2.9k
Forks
533
PR merge metrics
No merged PRs in 30d

Description

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:


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

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:


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

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! )

---
Originally reported by rjbwtr, imported from: BlueOcean API parallel node duration in ms incorrect in declarative pipeline


  • status: Open
  • priority: Minor
  • component(s): blueocean-plugin
  • resolution: Unresolved
  • votes: 6
  • watchers: 9
  • imported: 2025-12-01

Raw content of original issue

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! )

environment

```
Jenkins: CloudBees Jenkins Enterprise 2.46.24.0.2-fixed

Pipeline - Declarative: 1.2.4

Blue Ocean: 1.3.3
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.