Pipeline/Timeout: "timeout" with a "withEnv" insite don't time out

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      The following code ends regular after 5 seconds, but I expect a fail after 3 seconds.

      node {
          timeout(time: 3, unit: 'SECONDS') {
              withEnv(["JAVA_1_6_HOME=JDK 1.6"]) {
                  sh "sleep 5"
              }
          }
      }
      

      Log:

      Started by user anonymous
      [Pipeline] node
      Running on jenkins-dc01-lx-cedba63f-3b32-4286-b784-4af03f3a44b3 in /home/jenkins/workspace/test
      [Pipeline] {
      [Pipeline] timeout
      [Pipeline] {
      [Pipeline] withEnv
      [Pipeline] {
      [Pipeline] sh
      [test] Running shell script
      + sleep 5
      [Pipeline] }
      [Pipeline] // withEnv
      [Pipeline] }
      [Pipeline] // timeout
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      Finished: SUCCESS
      

            Assignee:
            Jesse Glick
            Reporter:
            M V
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: