views:

495

answers:

4

I'm setting up CI at present using Thoughtworks Studios' Cruise, Gallio to run xunit.net fact/tests, and ncover 2 to do code-coverage.

I noticed that running the code-coverage pegs one of the four CPUs that our build-agent server has, and wondered whether there was a multi-threaded test-runner that I might use instead, to take advantage of the other 3 cores that are sat idle? I had a quick search around, but most hits are in reference to testing multi-threaded code, not multi-threaded test running...

A: 

If nothing else, I know that in CruiseControl.NET, you could multiple two operations run simultaneously. I would think the same would be true for Cruise. You could have four instances of run on 1/4 of your tests each, and then stitch the results back together. Knowing when to merge them may be difficult though.

Jacob Adams
+1  A: 

In NUnit you can pass a /thread parameter which spawns test execution in a different thread. I'd imagine it wouldn't be too much more work to have a thread pool to spawn tests from. You'd have to make darn sure you don't have dependencies in your tests.

I'd ask on either the xUnit.NET or NUnit lists. I know Charlie is working to make that part of NUnit 3.0. You can also look at PNunit as an extension. There's also an article with someone working towards getting xUnit.NET in multiple threads.

Cory Foy
+1  A: 

Just yesterday i came across this post by Damon Payne:

http://www.damonpayne.com/2008/05/09/ConcurrentUnitTestingWithXUnitNet1.aspx

where he walks through writing a custom test runner for xUnit.NET that explicitly distributes test cases using the class as the unit of concurrency in order to take advantage of multiple cores.

David Alpert
+2  A: 

Gallio implements parallel test execution.

Mauricio Scheffer