4
votes

I'm running into a frustrating issue with nUnit 3. I believe this issue was also happening with nUnit 2, but it's happening more frequently now.

In VS2015 upon compiling I will suddenly lose half of my unit tests in the Test Explorer after a build. A clean build or visual studio restart will fix it, but that's really annoying in a large solution. I haven't determined why some tests continue to show up and others disappear - a comparison of the project files show they are using the identical libraries and project settings.

I am using nUnit3 with the nUnit3 test adapter installed as an extension as well as the nuget package (tried nuget package only, tests don't show up)

1
Very likely to be a bug in the adapter. Other test frameworks work fine.Lex Li
Did you find a solution for that? I'm also struggling with this annoying bug.shay__
I'm glad to hear I'm not the only one suffering from this issue. I'm using NUnit 2.6 on VS 2015 through the NuGet extension. I'm curious whether this would be a VS bug, or an NUnit one, so we could bark up the right tree.Grimace of Despair

1 Answers

1
votes

This particular issue was fixed in adapter version 3.0.9. See issues 126 and 131.

The casue, from Charlie Poole:

I discovered that we were getting a COM exception from VS when calling RecordEnd on Explicit Tests for which no RecordStart was called. This does not seem to actually cause a problem for earlier VS products but appears to do so for VS2015. I'm catching the exception and displaying a message. This seems to eliminate the intermittent failures of VS2015 to complete the execution of tests but I'm not certain the problem won't pop up again.

In any case, it still seems like a good idea that we don't propogate exceptions back to NUnit from the listener.