PDA

View Full Version : Bad Idea: Call Subroutine in Failure


martys
06-09-2006, 08:15 AM
I had a subroutine set up to log everything necessary during either a success or failure (either at the end of the build or as the failure step). However, when outputing the log fails, it runs the failure step... which calls the subroutine... which fails and calls the failure step... which goes into an infinite loop. So that might want to be fixed.

buckleyc
06-09-2006, 09:43 AM
May I suggest a workaround?

If you keep a counter or if there is an internal counter for number of failures, you could use a script step to check the counter and if it is beyond the threshold, stop the build.

I agree with adding some sort of way to prevent this. It would be nice if there was an option of "Do not execute if number of failed steps exceeds x."

kinook
06-09-2006, 12:47 PM
It's probably a good idea to configure any steps that get called from failure steps and that might fail to not build failure steps and (possibly) continue building.