- 
    
Bug
 - 
    Resolution: Duplicate
 - 
    
Major
 - 
    None
 - 
    Jenkins: 2.0 / 2.1
Build timeout plugin: 1.16
Pipeline Plugin: 2.0 / 2.1
Xvnc plugin: 1.23 
This code end regular after 10 seconds, but I expect a fail after 3 seconds.
node {
        timeout(time: 3, unit: 'SECONDS') {
                wrap([$class: 'Xvnc']) {
                        sh "sleep 10s"
                }
        }
}
Log:
Started by user anonymous
[Pipeline] node
Running on jenkins-worker01 in /var/lib/jenkins/workspace/Test
[Pipeline] {
[Pipeline] timeout
[Pipeline] {
[Pipeline] wrap
Starting xvnc
[Test] $ vncserver :28 -localhost -nolisten tcp
New 'jenkins-worker01:28 (jenkins)' desktop is jenkins-worker01:28
Starting applications specified in /var/lib/jenkins/.vnc/xstartup
Log file is /var/lib/jenkins/.vnc/jenkins-worker01:28.log
[Pipeline] {
[Pipeline] sh
[Test] Running shell script
+ seq 1 10
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
[Pipeline] }
Terminating xvnc.
$ vncserver -kill :28
Killing Xvnc4 process ID 60601
[Pipeline] // wrap
[Pipeline] }
[Pipeline] // timeout
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
This code fail with a timeout after 5 seconds, instead of the expected 3 seconds:
node {
        timeout(time: 3, unit: 'SECONDS') {
                wrap([$class: 'Xvnc']) {
                          timeout(time: 5, unit: 'SECONDS') {
                                   sh "sleep 10s"
                           }
                }
        }
}
Log:
Started by user anonymous
[Pipeline] node
Running on jenkins-worker01 in /var/lib/jenkins/workspace/Test
[Pipeline] {
[Pipeline] timeout
[Pipeline] {
[Pipeline] wrap
Starting xvnc
[Test] $ vncserver :15 -localhost -nolisten tcp
New 'jenkins-worker01:15 (jenkins)' desktop is jenkins-worker01:15
Starting applications specified in /var/lib/jenkins/.vnc/xstartup
Log file is /var/lib/jenkins/.vnc/jenkins-worker01:15.log
[Pipeline] {
[Pipeline] timeout
[Pipeline] {
[Pipeline] sh
[Test] Running shell script
+ seq 1 10
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
Sending interrupt signal to process
Terminated
[Pipeline] }
[Pipeline] // timeout
[Pipeline] }
Terminating xvnc.
$ vncserver -kill :15
Killing Xvnc4 process ID 60523
[Pipeline] // wrap
[Pipeline] }
[Pipeline] // timeout
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 143
Finished: FAILURE
- duplicates
 - 
                    
JENKINS-34637 pipeline DSL: timeout() does not work if withEnv() is enclosed
-         
 - Resolved
 
 -         
 
- is related to
 - 
                    
JENKINS-36010 Pipeline/Timeout: "timeout" with a "withEnv" insite don't time out
-         
 - Resolved
 
 -