gerbenvl

Can I limit the time a team build is running in some way Sometimes people write tests that take too much time on the build server, so I'd like to limit these kind of builds to let's say 1 hour. It should just kill the build when it isn't finished in that timespan.

Any ideas

Thanks,

Gerben.



Re: Team Foundation Server - Build Automation Set limit on build time

Aaron Hallberg - MSFT

You could write a custom task that spawns a process which, after a set amount of time, calls the BuildController.StopBuild method. I am reasonably sure that this should work, and that it shouldn't cause any problems when the build doesn't take that long (the spawned process should get cleaned up with the rest of the build's resources).

See my blog post here for an example of a custom task that calls a Team Build web service. Also note that you'll want to get this task started early on in the build process - I would recommend overriding the BeforeEndToEndIteration target.

-Aaron





Re: Team Foundation Server - Build Automation Set limit on build time

gerbenvl

Thanks for your quick reply Aaron, I'm going to give it a try.

Gerben.





Re: Team Foundation Server - Build Automation Set limit on build time

gerbenvl

Another way to solve this is to specify a maximum run time for the unit tets in the testrunconfig.

Gerben.