Execute command line before timeout

Answered

Hello,

I have configured a unit test build step using google test in command line. I have also configured a timeout, let's say: I don't want the unit tests to run more than xx minutes.

When it happens, I'd like to know the callstack before killing the process, by using a command line tool like ProcDump. But to achieve that, I need to launch the tool just before the timeout.

Is there a trigger or another way to execute a command line before the timeout kills the process?

0
3 comments
Avatar
Permanently deleted user

I am not aware of such a mechanism in Team City to my knowledge. You probably need to have your own wrapper which executes necessary command when the timeout triggers and just before killing the process.

0

Hi Tony,

You can add the last build step with Execution step: "Always, even if build stop command was issued" option selected. In this case the last step will run even if build fails because of timeout.

0

I know this is an old thread but what Alina Mishina state above is incorrect.

If a job suffers a timeout in a previous build step, then all following build steps are skipped (even if they are marked as: "Always, even if build stop command was issued"):

Below is an example of a job that timed out during build step 4, with build step 5 marked as "Always, even if build stop command was issued"

[Step 4/6] Stopping build on agent. Reason: build execution timeout
[......]
[Step 5/6] Step 1/1: Kill any left-over processes (Python)
[00:03:51][Step 1/1] Build step Kill any left-over processes (Python) is skipped because the build was interrupted
0

Please sign in to leave a comment.