-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major
-
Component/s: pipeline
When a long running sh step with returnStatus is running, timeout error is not propagated.
Steps to reproduce:
1. Having this pipeline, I expect echo 'Continue ...' to never be executed because the internal sh step takes more than the timeout.
node {
stage('stage 1') {
test()
echo 'Continue working after timeout'
}
}
def test() {
timeout(time: 10, unit: 'SECONDS') {
echo 'working ...'
sh script: 'sleep 15'//, returnStatus: true
}
}
And that works.
2. If the same pipeline is executed removing the comment, enabling returnStatus: true, the interrupt signal is sent but the Pipeline continues and echo 'Continue working after timeout' is executed finishing with status SUCCESS.
Here is the log:
Timeout set to expire in 10 sec
[Pipeline] {
[Pipeline] echo
working ...
[Pipeline] sh
[test-pipeline] Running shell script
+ sleep 15
Sending interrupt signal to process
Cancelling nested steps due to timeout
Terminated
[Pipeline] }
[Pipeline] // timeout
[Pipeline] echo
Continue working after timeout
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS