Skip to content

Commit

Permalink
[JENKINS-48821] - Don't forget estimated duration of asynchronous jobs (
Browse files Browse the repository at this point in the history
#3329)

* Don't forget estimated duration of asynchronous jobs.

When jobs are executed, the estimated duration is calculated, memorized
and reseted when the job is finished.

But when the job is executed asynchronously (e.g. as for pipeline
scripts), the execution is just triggered. Therefore the estimated
duration should remain - and not be reseted after triggering.

JENKINS-48821: Time remaining for all pipeline jobs is N/A
JENKINS-49616: Estimated time remaining NA

* Reset cached estimated duration also when asynchronous job ends.

(cherry picked from commit 3fc3921)
  • Loading branch information
bernolanger authored and olivergondza committed Mar 23, 2018
1 parent 9b69208 commit 1400918
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/Executor.java
Expand Up @@ -459,7 +459,6 @@ public SubTask call() throws Exception {
if (asynchronousExecution == null) {
finish2();
}
executableEstimatedDuration = DEFAULT_ESTIMATED_DURATION;
}
}

Expand Down Expand Up @@ -490,6 +489,7 @@ private void finish2() {
if (this instanceof OneOffExecutor) {
owner.remove((OneOffExecutor) this);
}
executableEstimatedDuration = DEFAULT_ESTIMATED_DURATION;
queue.scheduleMaintenance();
}

Expand Down

0 comments on commit 1400918

Please sign in to comment.