13

I am looking for a way to fail a build if it will take more than X time (be it absolute (5 minutes -- example) or relative (10% more than the average of the last 5 builds -- example).

Is there any plugin to do that or should I build such functionality onto my running scripts?

I've been searching for plugins but couldn't find one that will mark a build as fail, only report build times.

1

2 Answers 2

9

There is a build timeout plugin:

This plugin allows you to automatically abort a build if it's taking too long. Once the timeout is reached, Jenkins behaves as if an invisible hand has clicked the "abort build" button.

1
  • I have totally overlooked the fact that this plugin can actually mark the build as failed (the description and docs only talk about 'abort'). I'll try this one!
    – Daniel
    Dec 6, 2016 at 16:54
5

A similar question was asked on SO.

You can use a code timeout if your workflow steps are scripts. Otherwise, the Build Timeout plugin might do the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.