Equals (IEquatable implementation) marked as not covered
Equals (IEquatable implementation) marked as not covered
Hi there
NCover (or NCover Explorer, respectively) marks this test for null as uncovered:
public bool Equals(VersionInfo vi)
{
//check for null values
if (vi == null)
{
//this block is marked as uncovered
Console.WriteLine("covered!");
return false;
}
//more code, marked as covered
}
However, this code is in fact covered - the console output appears if I run the test normally (TestDriven add-in). I assume this is because this Equals method does not override object.Equals, but implement the new generic IEquatable<VersionInfo> interface (argument is not object).
Apart from that, NCover works like a charm - I love it :)
Cheers,
Philipp
Re: Unable to read beyond the end of the stream
See http://ncover.org/SITE/forums/thread/1140.aspx
I recall seeing similar posts made in the past with previous NCover versions as well - and from what I recall it has been something that Peter has struggled to replicate. I've never experienced it myself or else I would have "volunteered" to be a guinea pig to help get this resolved.
I'm sure Peter would appreciate any assistance you can offer in terms of replicating the issue allowing him to debug it. Out of curiosity, do you still get the error if you only run a smaller subset of the tests - any way to try to isolate it down?
Re: Unable to read beyond the end of the stream
Hi Grant,
thanks for your quick response. I'll break the test assembly down and run various subsets to see if I can isolate it that way.
The project is a large corporate project, so I don't think the powers that be would be happy about code leaving here. However, I'm happy to offer Peter any assistance that he may need to get closer to the heart of the issue,
Cheers,
Mark
Re: Unable to read beyond the end of the stream
I have a theory about this problem. It's very difficult to replicate, but if you have a program that takes a substantial amount of time to report out the code coverage data it seems to be more likely. Since the data reporting is happening during the process shutdown sequence, the O/S kills off the process because it is taking too long to shutdown. I have an idea about how to get around this, but I haven't had a chance to implement it yet.
Re: Unable to read beyond the end of the stream
Hi Peter,
Thanks for the info. I've broken the existing test project down and the problem goes away, and started adding tests to a new test project.
When I added the new tests, the problem happened again.
When I backed out a few tests, I was able to produce a coverage.xml file. So, there seems to be a size threshold, which would also fit in with your theory,
Cheers,
Mark
Re: Unable to read beyond the end of the stream
Hi,
I also get a similar problem when running a large test suite (coverage.log around 60Mb, 15 Assemblies). There are two kind of problems but I guess they could be related to each other as they always occur at the end of the test run:
1.) On our Windows 2003-BuildServer (2GB-Memory) I get an OutOfMemory-Exception but always at the end of the testrun. NUnit always allocates around 500MB of Memory at the end of the testrun seconds before crashing. Following stack-trace shows where it crashes:
mscorlib.dll!System.Runtime.Remoting.Proxies.ReaIProxy.HandIeReturnMessage(System.Runtime.Remoting.Messaging.IMessage ....
mscorlib.dll!System.Runtime.Remoting.Proies.RealProy.PrivateInvoke(ref System.Runtime.Remoting.Proxies.MessageData msgD .....
[Native to Managed Transition]
[Managed to Native Transition]
nunit.core.dll!NUnit.Core.SuiteFinishedEvent.Send(NUnit.Core.EventListener listener) + 0x80 Bytes
nunit.core.dll!NUnit.Core.EventPump.PumpThreadProc() + 0x99 Bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x5c Bytes
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.C
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x41 Bytes
[Appdomain Transition]
I don't know how that profiling really works but to me it looks like all the data is transfered at the end of the testrun to NCover. It looks like the data is somewhere queued but that queue is getting to large.
2.) Once I got a the "Unable to read beyond the end of the stream" in the coverage.log. In that case no OutOfMemory-Exception was reported.
Could that help? Are those problems related to each other?
Thanks for any ideas, or workarounds ....
JJ
Re: Unable to read beyond the end of the stream
Peter,
Here are some more observations:
I can not get this to happen on my XP box. It has 2Gigs of memory and a DualCore proc.
When I run the same thing on a Windows 2003 it will bomb not matter what I do, except for one thing. If I reduce the covered assemblies to just one it will work.
I can reproduce this on demand.
Re: Unable to read beyond the end of the stream
I can reproduce this on demand.