locked
Invoke additional actions before MSTest timeout kills process threads RRS feed

  • Question

  • When a C# testmethod exceeds the timeout, MSTest test agent will forcefully terminate the test and all child threads/processes. TestCleanup() is then invoked to help with any additional tear-down activities.

    I would like a way to capture additional logging information, such as invoking a screen capture or gathering additional system/application text logs, BEFORE MSTest terminates all processes. I already have the methods and functions to capture these logs. The problem is timing.

    Is there a way for me to specify additional tasks or actions upon testmethod timeout before MSTest kills all processes? I suppose I could code a timeout loop inside my testmethod, but then I'd have to do it for all testmethods and that's not preferable.
    Wednesday, April 23, 2014 8:32 PM

Answers