I've followed the instructions on http://blogs.msdn.com/b/vstsqualitytools/archive/2009/12/01/executing-unit-tests-in-parallel-on-a-multi-cpu-core-machine.aspx to the letter and I can execute tests in parallel.
So far so good.
Now the problem: I can't set the parallelTestCount to zero (Auto configure) or to a value above 5. Running five parallel tests works fine but not six.
Yes I have more than five cores on my machine; I am running on an Intel i7 processor which has four cores with hyperthreading meaning I should be able to run 8 tests in parallel.
Now I'm sure there are some other logical or hard limitations and I am not expecting to be able to run on eight cores lightning-speeding eight tests through in parallel.
However it would be cool to know the reason for it not running more than five tests in parallel?
Running unit tests in parallel can significantly improve the speed at which they run. However, you have to make sure that one test does not affect another in any way. Else your tests are green most of the time, but sometimes one or more tests will fail.
What is Parallel Testing? Parallel testing means running multiple automated tests simultaneously to shorten the overall start-to-end runtime of a test suite. For example, if 10 tests take a total of 10 minutes to run, then 2 parallel processes could execute 5 tests each and cut the total runtime down to 5 minutes.
Parallel Testing is a process to leverage automation testing capabilities by allowing the execution of the same tests simultaneously in multiple environments, real device combinations, and browser configurations.
Once the parallel execution property is set (or enabled), the JUnit Jupiter engine will run the tests in parallel as per the configurations provided with the synchronization mechanisms.
It seems that this is a bug in MSTest. I have stumbled upon the same problem, all tests are marked as aborted and there is a "Test run error" link in the Test Results window which if clicked yields this message: "Test run is aborting on '', number of hung tests exceeds maximum allowable '5'".
Update: It is fixed in the Visual Studio 2010 Service Pack.
It could just be me but hyperthreading isn't a real core so an i7 only really has 4 physical cores not 8. Maybe it is something to do with that.
Or perhaps there is some bios setting relating to how the hyperthreading can be used by the OS that is preventing it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With