Daily Usage Issues

VS2012 - Beginning of test not marked where a test is failing, coverage markers incorrect

Started by penguat on 9,555 views

Where a test is failing in my big VS2012 solution, the markers are showing no coverage above the exception, where they should show failing coverage. The beginning of the test is also not marked. Tests further down the same testfixture are showing as not covered. These are NUnit tests.

External image

My markers for no coverage are blue, as I sometimes use a dark theme.

thread settings - 2 threads, including a fast lane, optimised for memory efficiency, running in parallel, running all tests automatically.

This isn't the behaviour I expect from NCrunch - even if it is effectively running single-threaded.

Thanks!

NCrunch maps code coverage information separate from exception lines. Although in normal situations they should align nicely, sometimes there are things that can cause them to go askew. A couple of the things that I'm aware of are:

- If you have code executing in a different application domain from the test runner (i.e. you've built your own app domain at test runtime), then executed code in this domain throws an exception. NCrunch cannot record code coverage in the application domain, but it will still pick up the exception stack trace
- If you have test code that somehow emits an exception stack trace for a part of your system that isn't actually covered by the test (technically this is possible, though very unusual)

Based on the fact that the screenshot you've shown is very close to the root of the test, I suspect that is actually a mapping issue of some kind (i.e. defect). Does the problem occur consistently for you? Or does it go away after you reset the NCrunch engine? if it's still happening, I'd really like to see the log file from a bug report if you're able to push one through.


Cheers,

Remco
Sadly, it doesn't look like i can reproduce it. We don't build our own app domain at test runtime, nor would this be code that's not covered. I'm sorry I didn't think to file a bug report at the time! It occurred consistently until I changed the settings - I hit the reset button a few times.

I have restarted the computer since then, which might've had something to do with it, and I changed to using 3 threads for a while, rather than just two.

If I spot it again, you'll get a bug report, I promise!
Thanks! I think this was probably the result of a known mapping issue that's been floating around lately. It appears more or less randomly, infrequently and to date I haven't been able to reproduce it. Usually a reset of the engine will solve the problem. Thanks for taking the time to report it.
I've submitted a bug report - something similar if not necessarily identical. My tests are showing multiple start markers, both failing and passing.

External image
Thanks for the report - I've seen this one come through and will make an effort to get to the bottom of it. Do also let me know if you manage to find clear steps to reproduce.


Cheers,

Remco

Post a reply

Log in to reply.