Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a TeamCity build fail (timeout) if it takes too long?

Tags:

teamcity

How do we put a timeout on a TeamCity build?

We have a TeamCity build which runs some integration tests. These tests read/write data to a database and sometimes this is very slow (why it is slow is another open quesiton).

We currently have timeouts in our integration tests to check that e.g. the data has been written within 30 seconds, but these tests are randomly failing during periods of heavy use.

If we removed the timeouts from the tests, we would want to fail the build only if the entire run took more than some much larger timeout.

But I can't see how to do that.

like image 619
Paul McKenzie Avatar asked Dec 01 '11 10:12

Paul McKenzie


People also ask

How to mark a build as failed in TeamCity?

Another build failure condition causes TeamCity to mark build as failed when a certain text is present in the build log. To add such failure condition, click Add build failure condition and select from the list: Fail build on metric change.

How do I create a build configuration in TeamCity?

Go to Administration | Projects and open the required project. Alternatively, open the project using the Projects pop-up menu and click Edit Project Settings. The Project Settings page will open. On the Project Settings page, click Create build configuration under the Build Configurations section.

How do I run a build on TeamCity?

To run a custom build with specific changes, open the build results page, go to the Changes tab, expand the required change, click the Run build with this change, and proceed with the options in the Run Custom Build dialog. Use HTTP request or REST API request to TeamCity to trigger a build.


1 Answers

On the first page of the build setup you will find the field highlights in my screenie - use thatenter image description here

like image 189
stack72 Avatar answered Sep 30 '22 14:09

stack72