-
Bug
-
Resolution: Unresolved
-
Major
-
None
- Linux - Debian
- Jenkins 2.204.2
- Create pipeline:
pipeline { agent any stages { stage('Ping') { steps { script { for (def i = 0; i < 500; i++) { echo "currentResult: ${currentBuild.currentResult}" sh "ping 127.0.0.1 -c 1" } } } } } }
- run pipeline
- Abort pipeline
- View build log
Expected: pipeline aborts
Actual: - The pipeline gets resumed, without interruption
- updated code to see the expected behauvior
pipeline { agent any stages { stage('Ping') { steps { script { for (def i = 0; i < 500; i++) { if (currentBuild.rawBuild.getActions(jenkins.model.InterruptedBuildAction.class).isEmpty()) { echo "currentResult: ${currentBuild.currentResult}" } else { echo "ABORTED" error("aborted") } sh "ping 127.0.0.1 -c 1" } } } } } }