Issues when running NCover/Unittest Multi-threaded

Issues when running NCover/Unittest Multi-threaded

Hi,

We've had this come up a few times and I can't seem to find any information in my searches so I figured I'd post here. We're running our unit tests in parallel across 6 threads. Occasionally we get failures with the following error and it appears to be coming from NCover itself and not our tests. Here's sample output of the failure from our nant scripts.

"C:\Program Files\NCover\NCover.Console.exe" //na //ea CoverageExcludeAttribute //w D:\Build\Repository.Temp\UnitTests //x "D:\Logs\Build\ncover_temp\coverage_UnitTests.dll.xml" D:\Build\3rdPartyLibs\NUnit\nunit-console.exe UnitTests.dll /xml="D:\Logs\UnitTests.dll.xml" /noshadow /exclude="UsesNunitWeb")' in 'D:\Build\Repository.Temp\UnitTests' NCover Complete v3.0.15 x86 (Administrator) Code Coverage for .NET Copyright (c) 2007 - 2009 Gnoso Inc. http://www.ncover.com Registered to Customer #: 5446 for 3 Machines Command: "D:\Build\3rdPartyLibs\NUnit\nunit-console.exe" Command Args: "UnitTests.dll" "/xml=D:\Logs\UnitTests.dll.xml" "/noshadow" "/exclude=UsesNunitWeb" Working Directory: D:\Build\Repository.Temp\UnitTests Assemblies: (All Loaded Assemblies) Excluded Attributes: CoverageExcludeAttribute Program Output Exception -- Top-level exception (System.IO.IOException) Illegal operation attempted on a registry key that has been marked for deletion. -- Stack Trace at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str) at Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind) at Microsoft.Win32.RegistryKey.SetValue(String name, Object value) at NCover.Framework.ProfilerDriver._RegisterProcess(String regPath) at NCover.Framework.ProfilerDriver.ExecuteNCover(Int32& profiledAppCode) at NCover.Framework.ProfilerDriver.Execute(Int32& profiledAppCode) at NCover.ConsoleMain.ConsoleMain.Main(String[] args)

So, does NCover write and read the same keys from the registry, is it not thread safe? Any ideas? Are there different arguments we should be using?

Thanks,

M


RE: Issues when running NCover/Unittest Multi-threaded

clarify: when you say that your unit tests are running in parallel, does that mean that you're launching 6 copies of NCover?

suggestion: update to 3.0.18, which may resolve the error, if it's caused by what I think it is caused by (reading/writing keys from the registry)


RE: Issues when running NCover/Unittest Multi-thre

Yes, up to 6 instances could be running at a time. I'll try the latest version and keep you posted.

Thanks,

M


RE: Issues when running NCover/Unittest Multi-threaded

roger