[JIRA] [workflow-plugin] (JENKINS-34637) pipeline DSL: timeout() does not work if withEnv() is enclosed

2016-05-05 Thread anthonylee.wall...@gmail.com (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Tony Wallace edited a comment on  JENKINS-34637 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: pipeline DSL: timeout() does not work if withEnv() is enclosed  
 
 
 
 
 
 
 
 
 
 This  pipeline DSL  works as expected: ie, the "sleep" is interrupted at 20 seconds, the timeout exception is caught, the build ends  {{Timeout has been exceeded}}  . {noformat}def err = nulltry{timeout(time:20, unit:'SECONDS') {node('chapcs00-ptmp') {sh '''#!/bin/bash -exsleep 60'''}}} catch( caughtError ) {println 'catch'err = caughtError} finally {println 'finally'if(err) {throw err}}console output:Started by user Tony Wallace[Pipeline] timeout[Pipeline] {[Pipeline] nodeRunning on chapcs00-ptmp in /ptmp/jenkins/chapel-ci/chapcs00-ptmp/workspace/Z-timeout[Pipeline] {[Pipeline] sh[Z-timeout] Running shell script+ sleep 60Sending interrupt signal to process/ptmp/jenkins/chapel-ci/chapcs00-ptmp/workspace/Z-timeout@tmp/durable-28979ffb/script.sh: line 2: 90895 Terminated  sleep 60[Pipeline] }[Pipeline] // node[Pipeline] }[Pipeline] // timeout[Pipeline] echocatch[Pipeline] echofinally[Pipeline] End of PipelineTimeout has been exceededFinished: ABORTED{noformat}This  DSL script  does  *  not *  work as expected: the sleep runs all the way to 60 seconds. THEN the build ends the same way,  {{Timeout has been exceeded}},  except timeout did not actually interrupt anything.    {noformat}def err = nulltry{timeout(time:20, unit:'SECONDS') {node('chapcs00-ptmp') {withEnv(['BLAH=foo',]) {sh '''#!/bin/bash -exsleep 60: should not be here'''}}}} catch( caughtError ) {println 'catch'err = caughtError} finally {println 'finally'if(err) {throw err}}console output:Started by user Tony Wallace[Pipeline] timeout[Pipeline] {[Pipeline] nodeRunning on chapcs00-ptmp in /ptmp/jenkins/chapel-ci/chapcs00-ptmp/workspace/Z-timeout[Pipeline] {[Pipeline] withEnv[Pipeline] {[Pipeline] sh[Z-timeout] Running shell script+ sleep 60+ : should not be here[Pipeline] }[Pipeline] // withEnv[Pipeline] }[Pipeline] // node[Pipeline] }[Pipeline] // timeout[Pipeline] echocatch[Pipeline] echofinally[Pipeline] End of PipelineTimeout has been exceededFinished: ABORTED{noformat} 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265) 
 
 
 
 
  

[JIRA] [workflow-plugin] (JENKINS-34637) pipeline DSL: timeout() does not work if withEnv() is enclosed

2016-05-05 Thread anthonylee.wall...@gmail.com (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Tony Wallace updated an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Jenkins /  JENKINS-34637 
 
 
 
  pipeline DSL: timeout() does not work if withEnv() is enclosed  
 
 
 
 
 
 
 
 
 
 
configuration details attached. 
 
 
 
 
 
 
 
 
 

Change By:
 
 Tony Wallace 
 
 
 

Attachment:
 
 jenkins.txt 
 
 
 

Attachment:
 
 linux.txt 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] [workflow-plugin] (JENKINS-34637) pipeline DSL: timeout() does not work if withEnv() is enclosed

2016-05-05 Thread anthonylee.wall...@gmail.com (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Tony Wallace updated an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Jenkins /  JENKINS-34637 
 
 
 
  pipeline DSL: timeout() does not work if withEnv() is enclosed  
 
 
 
 
 
 
 
 
 

Change By:
 
 Tony Wallace 
 
 
 
 
 
 
 
 
 
 Pipeline/ workflow DSL: timeout() does not work as expected when a withEnv() is introduced inside the (same) timeout + node blocks and over the (same) shell command. Specifically, without the withEnv block, the timeout actually interrupts the shell command. With the withEnv block, the timeout does not interrupt the shell command; yet, the build still ends reporting that it was interrupted/ aborted.  
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] [workflow-plugin] (JENKINS-34637) pipeline DSL: timeout() does not work if withEnv() is enclosed

2016-05-05 Thread anthonylee.wall...@gmail.com (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Tony Wallace commented on  JENKINS-34637 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: pipeline DSL: timeout() does not work if withEnv() is enclosed  
 
 
 
 
 
 
 
 
 
 
The only difference between scripts with right and wrong behavior is 

 
withEnv(['BLAH=foo',]) {  } 

 
was added around the previous shell script 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] [workflow-plugin] (JENKINS-34637) pipeline DSL: timeout() does not work if withEnv() is enclosed

2016-05-05 Thread anthonylee.wall...@gmail.com (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Tony Wallace commented on  JENKINS-34637 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: pipeline DSL: timeout() does not work if withEnv() is enclosed  
 
 
 
 
 
 
 
 
 
 
This works as expected: ie, the "sleep" is interrupted at 20 seconds, the timeout exception is caught, the build ends .  

 
def err = null
try{
timeout(time:20, unit:'SECONDS') {
node('chapcs00-ptmp') {
sh '''#!/bin/bash -ex
sleep 60
'''
}
}
} catch( caughtError ) {
println 'catch'
err = caughtError
} finally {
println 'finally'
if(err) {
throw err
}
}

console output:

Started by user Tony Wallace
[Pipeline] timeout
[Pipeline] {
[Pipeline] node
Running on chapcs00-ptmp in /ptmp/jenkins/chapel-ci/chapcs00-ptmp/workspace/Z-timeout
[Pipeline] {
[Pipeline] sh
[Z-timeout] Running shell script
+ sleep 60
Sending interrupt signal to process
/ptmp/jenkins/chapel-ci/chapcs00-ptmp/workspace/Z-timeout@tmp/durable-28979ffb/script.sh: line 2: 90895 Terminated  sleep 60
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // timeout
[Pipeline] echo
catch
[Pipeline] echo
finally
[Pipeline] End of Pipeline
Timeout has been exceeded
Finished: ABORTED
 

 
This does not work as expected: the sleep runs all the way to 60 seconds. THEN the build ends the same way, except timeout did not actually interrupt anything.  

 
def err = null
try{
timeout(time:20, unit:'SECONDS') {
node('chapcs00-ptmp') {
withEnv(['BLAH=foo',]) {
sh '''#!/bin/bash -ex
sleep 60
: should not be here
'''
}
}
}
} catch( caughtError ) {
println 'catch'
err = caughtError
} finally {
println 'finally'
if(err) {
throw err
}
}

console output:

Started by user Tony Wallace
[Pipeline] timeout
[Pipeline] {
[Pipeline] node
Running on chapcs00-ptmp in /ptmp/jenkins/chapel-ci/chapcs00-ptmp/workspace/Z-timeout
[Pipeline] {
[Pipeline] withEnv
[Pipeline] {
[Pipeline] sh
[Z-timeout] Running shell script
+ sleep 60
+ : should not be here
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // timeout
[Pipeline] echo
catch
[Pipeline] echo
finally
[Pipeline] End of Pipeline
Timeout has been exceeded
Finished: ABORTED
 

 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
   

[JIRA] [workflow-plugin] (JENKINS-34637) pipeline DSL: timeout() does not work if withEnv() is enclosed

2016-05-05 Thread anthonylee.wall...@gmail.com (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Tony Wallace created an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Jenkins /  JENKINS-34637 
 
 
 
  pipeline DSL: timeout() does not work if withEnv() is enclosed  
 
 
 
 
 
 
 
 
 

Issue Type:
 
  Bug 
 
 
 

Assignee:
 
 Jesse Glick 
 
 
 

Components:
 

 workflow-plugin 
 
 
 

Created:
 

 2016/May/06 12:28 AM 
 
 
 

Environment:
 

 Jenkins 1.651.1, up-to-date pipeline and workflow plugins (list attached), IBM JRE 1.7.0, Linux 
 
 
 

Priority:
 
  Minor 
 
 
 

Reporter:
 
 Tony Wallace 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)