Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-26521

timeout step should support breaking on inactivity, not just a fixed duration

      Some of our test-suite items can occasionally deadlock, causing a build to never finish. The Build Timeout Plugin supports failing a job when nothing happens (i.e. no log output) for a sufficient length of time. It would be good to get this behaviour in Workflow.

          [JENKINS-26521] timeout step should support breaking on inactivity, not just a fixed duration

          Jesse Glick added a comment -

          Would be useful in some cases. I am not sure how difficult this would be. BuildTimeoutWrapper uses BuildWrapper.decorateLogger for this purpose, which is too low-level (assumes access to an OutputStream for the whole build) and so is not available in a workflow (cf. JENKINS-24673). There would have to be something like a TaskListenerDecorator which could be passed into BodyInvoker.withContext and interpreted by LogActionImpl, perhaps.

          By the way for the use case originally reported here, it is arguably better to just impose a per-suite timeout in the test framework or test runner, such as in Surefire.

          Jesse Glick added a comment - Would be useful in some cases. I am not sure how difficult this would be. BuildTimeoutWrapper uses BuildWrapper.decorateLogger for this purpose, which is too low-level (assumes access to an OutputStream for the whole build) and so is not available in a workflow (cf. JENKINS-24673 ). There would have to be something like a TaskListenerDecorator which could be passed into BodyInvoker.withContext and interpreted by LogActionImpl , perhaps. By the way for the use case originally reported here, it is arguably better to just impose a per-suite timeout in the test framework or test runner, such as in Surefire .

          ikedam added a comment -

          ikedam added a comment - Pipeline now supports ConsoleLogFilter ( JENKINS-27392 ) ! https://github.com/jenkinsci/workflow-basic-steps-plugin/pull/18

          Andrew Bayer added a comment -

          I've resurrected ikedam's original PR and tweaked it slightly - it's up at https://github.com/jenkinsci/workflow-basic-steps-plugin/pull/62

          Andrew Bayer added a comment - I've resurrected ikedam 's original PR and tweaked it slightly - it's up at https://github.com/jenkinsci/workflow-basic-steps-plugin/pull/62

          Henrik Koren added a comment -

          abayer when do you think that this change will be resolved 

          thanks 

          Henrik Koren added a comment - abayer when do you think that this change will be resolved  thanks 

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStep.java
          src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java
          src/main/resources/org/jenkinsci/plugins/workflow/steps/TimeoutStep/config.jelly
          src/main/resources/org/jenkinsci/plugins/workflow/steps/TimeoutStep/help-activity.html
          src/test/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepTest.java
          http://jenkins-ci.org/commit/workflow-basic-steps-plugin/1307d5a01782b571415131651791949da0e051be
          Log:
          [FIXED JENKINS-26521] Add activity flag to timeout step

          Many thanks to @ikedam for the original version of this. I've just
          resurrected it and tweaked a couple things.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStep.java src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java src/main/resources/org/jenkinsci/plugins/workflow/steps/TimeoutStep/config.jelly src/main/resources/org/jenkinsci/plugins/workflow/steps/TimeoutStep/help-activity.html src/test/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepTest.java http://jenkins-ci.org/commit/workflow-basic-steps-plugin/1307d5a01782b571415131651791949da0e051be Log: [FIXED JENKINS-26521] Add activity flag to timeout step Many thanks to @ikedam for the original version of this. I've just resurrected it and tweaked a couple things.

          Andrew Bayer added a comment -

          Merged, releasing as workflow-basic-steps 2.7 today.

          Andrew Bayer added a comment - Merged, releasing as workflow-basic-steps 2.7 today.

            abayer Andrew Bayer
            directhex Jo Shields
            Votes:
            7 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: