This seems to get of the path from my question but I'll try to explain. The test suite is run embedded into our build system. Each test case tries to close the application at the end, but that sometimes fails. Thus the next test case has to make sure, that the application is closed before running. Sometimes it happens, that the application is still in the process of closing when the next test case is started. In this case WaitProcess() returns true but Terminate() fails if the final closing of the process falls in-between the two function calls. This doesn't happen too often but every few times the test suite is run. Thus, the test suite fails randomly, depending on whether the server manages to close the application fast enough or not. I could include delay operations at the end of each test but this would significantly increase the overall time to run the test suite. There is already enough waiting for things to happen. But if this is the workaround for not being able to catch an exception then so be it 😞