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.


2 Answers 2


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.

  • 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
    Commented Dec 6, 2016 at 16:54

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 you have read our privacy policy.

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