Recently I noticed Visual Studio not responding for short periods of time while nCrunch was running tests in the background. I found corresponding Application Error events in the event log because nCrunch.TaskRunner451.x86.exe was crashing. After further investigation I managed to consistently reproduce the crashes every time Debugger.Break was called within a test being run.
I can prevent these calls being made from the tests, but still it would be great if you could avoid the runner crashing in such cases.
Remco NCrunch Developer
#5497
08 Mar 2014 11:05 UTC
Hi, thanks for posting!
Unfortunately, there is nothing NCrunch can do about the task runner crashing in this situation. The Debugger.Break method is responsible for this action, and NCrunch cannot intercept its activities. You'll find that other test runners have the same behaviour in this situation.
The Debugger.Break method falls into a similar category to Debugger.Launch, MessageBox.Show, etc. NCrunch has no way to handle this code as the code isn't designed to be executed using an automated test.
If you wish to disable the behaviour for NCrunch execution, you may want to look into using an override such as:
#if !NCRUNCH
Debugger.Break();
#endif
Unfortunately, there is nothing NCrunch can do about the task runner crashing in this situation. The Debugger.Break method is responsible for this action, and NCrunch cannot intercept its activities. You'll find that other test runners have the same behaviour in this situation.
The Debugger.Break method falls into a similar category to Debugger.Launch, MessageBox.Show, etc. NCrunch has no way to handle this code as the code isn't designed to be executed using an automated test.
If you wish to disable the behaviour for NCrunch execution, you may want to look into using an override such as:
#if !NCRUNCH
Debugger.Break();
#endif
Post a reply
Log in to reply.