7

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.

| improve this question | | | | |
6

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.

| improve this answer | | | | |
  • 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 '16 at 16:54
2

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.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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