How to stop all running tests?

We recently had to restart build agents on several servers. This caused some resources to leak because the cleanup scripts for the running tests were not executed. We have the cleanup scripts running as a Cleanup build step, with the execution policy set to Always execute.

Sending the "stop build" command to a server will cause the cleanup script to be executed, but we have ~70 build agents running at any given time. Manually sending "stop build" to each one is tedious. How can I send "stop build" to all running tests?

EDIT: Rewrote everything to clarify my question

0
3 comments

Hi Ryan,

I'm afraid I don't really follow what you want to do. You mention that you already restarted "several servers", which I assume are build agents. You can simply send the "stop build" command to any running build for it to be stopped. If the builds aren't running, you can simply disable all other build steps, or set cleanup as the first one. You can also delete the files manually.

If you are talking about the agents that are still running, then it should be possible to stop those builds from the build overview page.

If I missed something, could you please expand or show an example?

0
Avatar
Permanently deleted user

I rewrote my question, so hopefully it's clearer. I'm looking for a "stop all builds" command, so I don't have to "stop build" on 70+ build agents. Does it exist? If not, is there a way to fake it?

0

Hi Ryan,

thanks for the rewriting, that's definitely much clearer. There isn't a "stop all" button yet, but it should be possible to do it via the REST API: https://confluence.jetbrains.com/display/TCD10/REST+API#RESTAPI-BuildCanceling/Stopping

You can create a script that pulls all the running builds from the server, then launches the stop request for all of them. You might additionally want to combine it with stopping the build queue as well, as otherwise, stopping the builds will just make new builds start.

0

Please sign in to leave a comment.