Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is NUnit hanging from the command line, but not under TestDriven.NET?

If I start my unit tests from TestDriven.NET under VS2008, they run pretty much immediately.

If I start my unit tests using nunit-console.exe, the NUnit console hangs for five minutes before actually running my tests. If I attach a debugger, it seems to be spending its time in System.IO.MemoryStream.Read, called from System.Runtime.Serialization.Formatters, called from System.Runtime.Remoting, on the other side of some native-managed transitions called by NUnit.Core.ProxyTestRunner.Test.get. Sometimes, it's in System.Runtime.Serialization.ObjectManager.RecordFixup or .FindObjectHolder.

This is with NUnit-2.5.2 on 32-bit XP, fully patched. All assemblies are targeted to .NET 2.0.

What is nunit-console up to? Is there any way to persuade it to not do it?

like image 587
Garth Kidd Avatar asked Feb 25 '10 08:02

Garth Kidd


People also ask

Where is NUnit console installed?

By default the NUnit installation program places all of the files into the C:\Program Files\NUnit 2.4 directory. In the installation directory there are three sub-directories: bin, doc, and samples. Source code is no longer provided with the binary installation package.

How do I use NUnit console runner in Visual Studio?

Just add NUnit tests to your project and they will now magically show up in the Test Explorer and run when you hit the > button. Instead of the NuGet package, you'll need to use the test runner from the Visual Studio Gallery or from the Tools -> Extensions and Updates menu.


1 Answers

I cannot be sure, since I am also lucky to use a new version. You probably have a huge test suite with lots of tests, aren't you? If you do not need application domain isolation for other reasons, you can turn it off and then you save the remoting/marshaling time.

Try this please and give feedback to us how it went:

nunit-console.exe /noshadow /nologo /process Single /domain None whatever.dll 

There is also a way to add these options via the configuration files, if you do not want to touch your build scripts even with a stick. :)

like image 87
wigy Avatar answered Sep 20 '22 21:09

wigy