-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major
-
Component/s: pipeline-model-definition-plugin
-
None
Consider the following example:
pipeline {
agent {
    label 'linux'
}
stages {
stage('Successful stage') {
steps {
script {
sh "sleep 15" // intentionally not using sleep 15 step!
}
}
}
}
post {
success {
echo "Triggered post-success"
}
failure {
echo "Triggered post-failure"
}
unstable {
echo "Triggered post-unstable"
}
aborted {
echo "Triggered post-aborted"
}
}
}
Start the build, let it go into "sleep" and abort the build. The result will be:
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
[Pipeline] echo
Triggered post-aborted
[Pipeline] echo
Triggered post-failure
[Pipeline] }
The result is having both `post-aborted` and `post-failure` executed. What should have happened was to receive only `post-aborted` step.
I've also seen in the logs `post-unstable` and `post-failure`, but I am not sure how to provide a way to reproduce this. I'm not sure how that happened but I have seen it a few times on some of our builds.Â
Â
Â
- links to