I'm using Resharper 9.2 and NUnit 2.6.4 and ~120 unit tests. Sometimes when I start run tests resharper stops at random test and set it status to Aborted and skip the others. It is very inconvenient because I have manually run rest of tests. Are there any ways to get reason of Abortion, some resharper test run logs or something in NUnit to help solve my problem?
I also tried to use native NUnit runner but it sometimes throws exception which doesn't contain any useful info (some remoting exception which tells nothing useful)
I've tried to set "Run up to 1 assemblies in parallel" and "Use separate AppDomain for each assembly with tests" but it doesn't help.
UPD
I've reproduced this in debug mode, debug unit test just shut down and in output window I've found:
The program '[4572] JetBrains.ReSharper.TaskRunner.CLR4.exe: Program Trace' has exited with code 0 (0x0).
The program '[4572] JetBrains.ReSharper.TaskRunner.CLR4.exe: Managed (v4.0.30319)' has exited with code -1073741819 (0xc0000005) 'Access violation'.
It seems that problem is external's library unsafe code.
I also ran into a case where Resharper decided to consistently abort a test. It didn't call into unmanaged or anything freaky.
The answer was that it had an inadvertent recursive call resulting in a stackoverflow exception. This was evident when I decided to "debug" instead of "running" them.
So I assume that the general takeaway is that "aborted" tests is symptomatic that something went wrong, but the error did not result in an exception being thrown from the code itself, but from the CLR or something.
It seems that resharper has nothing to do in this case. I've got Access Violation error and in this case tester process will be shut down. There is no way in .net to process this error because it is not on managed level. The only thing is to check in output window if error message is like: "The program '[4572] JetBrains.ReSharper.TaskRunner.CLR4.exe: Managed (v4.0.30319)' has exited with code -1073741819 (0xc0000005) 'Access violation'" when your tests are aborted for no reason. If you have access to native code you can debug.
In my case the problem was in improper use of COM object and Dispose() method. I've fixed it and everything is ok now - no "silent" abortion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With