How can I run NUnit tests in parallel?

Billy ONeal picture Billy ONeal · Jul 22, 2010 · Viewed 49.4k times · Source

I've got a large acceptance test (~10 seconds per test) test suite written using NUnit. I would like to make use of the fact that my machines are all multiple core boxes. Ideally, I'd be able to have one test running per core, independently of other tests.

There is PNUnit, but it's designed for testing for threading synchronization issues and things like that, and I didn't see an obvious way to accomplish this.

Is there a switch/tool/option I can use to run the tests in parallel?

Answer

David_001 picture David_001 · Aug 1, 2010

If you want to run NUnit tests in parallel, there are at least 2 options:

  • NCrunch offers it out of the box (without changing anything, but is a commercial product)
  • NUnit 3 offers a parallelizable attribute, which can be used to denote which tests can be run in parallel