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

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

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            jglick 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.

            Show
            jglick 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 .
            Hide
            ikedam ikedam added a comment -
            Show
            ikedam ikedam added a comment - Pipeline now supports ConsoleLogFilter ( JENKINS-27392 ) ! https://github.com/jenkinsci/workflow-basic-steps-plugin/pull/18
            Hide
            abayer 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

            Show
            abayer 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
            Hide
            henrikk Henrik Koren added a comment -

            Andrew Bayer when do you think that this change will be resolved 

            thanks 

            Show
            henrikk Henrik Koren added a comment - Andrew Bayer when do you think that this change will be resolved  thanks 
            Hide
            scm_issue_link 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.

            Show
            scm_issue_link 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.
            Hide
            abayer Andrew Bayer added a comment -

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

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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: