Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What prevents MSTest from running in parallel?

What can prevent MSTest from running in parallel? I set the parallelTestCount to 0, but it is still running one test at a time.

like image 431
Jonathan Allen Avatar asked Jan 14 '11 21:01

Jonathan Allen


People also ask

Does MSTest run tests in parallel?

As opposed to the other frameworks which only allow parallelization at the class level. So, for example, If you have 100 test methods in 5 classes, MSTest will let you run 100 tests in parallel. However, with NUnit, you can only run the 5 tests in parallel, one from each test class at the time.

What determines if the runner must parallelize test at the method or class level?

Scope : Determine if the runner must parallelize tests at the method or class level. MethodLevel will run all tests in parallel. ClassLevel will run all test classes in parallel, but tests in a class are run sequentially. You should use ClassLevel if the tests within classes have interdependencies.

Does TestInitialize run for each test?

TestInitialize and TestCleanup are ran before and after each test, this is to ensure that no tests are coupled. If you want to run methods before and after ALL tests, decorate relevant methods with the ClassInitialize and ClassCleanup attributes.

Does NUnit run tests in parallel?

The NUnit 3.0 framework can run tests in parallel within an assembly. This is a completely separate facility from Engine Parallel Test Execution, although it is possible to use both in the same test run. By default, no parallel execution takes place.


3 Answers

One possibility you may not have tried yet... This article mentions that you need to restart your environment before the changes will take effect. Also, have you made any changes to your testsettings before setting parallelTestCount to 0? If so you'd have to make the changes again. Hope this helps!

like image 98
khr055 Avatar answered Jan 14 '23 16:01

khr055


You must not have any data collectors configured and you cant run any Coded UI tests.

This article contains all the details I think.

like image 28
Pete Stensønes Avatar answered Jan 14 '23 17:01

Pete Stensønes


Not having multiple cores. See this post.

like image 29
Mike Zboray Avatar answered Jan 14 '23 15:01

Mike Zboray