Looking for the best way to handle a teamcity build timeout
I'm looking for a way to collect failure history in sentry. This is important for knowing why a build config which runs tests fail: A) Test execution failure? B) Build timeout when tests are still running? C) Some other reason?
Cases A and B are the ones of particular interest which I want to collect in sentry. The test code that gets executed covers case A but case B is difficult to manage. When a build times out, it doesn't allow runners some grace period for processes to handle cleanup, they just die immediately. This means an exception handler in the test code which would normally notify sentry cannot execute. What is the best way to handle a timeout case such that failure information can be sent to sentry when a timeout happens?
Please sign in to leave a comment.
Hello Sean,
There is a new feature in the latest version of TeamCity that might be useful for your use case, that allows to run steps only if build fails:
https://www.jetbrains.com/help/teamcity/2023.05/what-s-new-in-teamcity.html#Run+Steps+Only+for+Failed+Builds
Perhaps you could use this to have a build step that would notify sentry if the build fails.