2

I hope somebody can help me.

I have a lot of UnitTest to my C# application in VS2010, and therefore I want to execute them in parallel so I can benefit of my four core machine. This is "easily" done by adding parallelTestCount="0" to the execution in the Local.testsettings.

But some of my UnitTest (around 50) are not thread safe and instead of reworking them, I just want them to be run in not parallel mode.

Is that possible and if so how to do it?

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
JerryA
  • 153
  • 1
  • 8

1 Answers1

0

You can't change the parallelism on a single test or set of tests. You could try to create a second test settings file and a second assembly containing your "unsafe" tests; you can define the folder that test assemblies are loaded from under the "Unit test" tab of the test settings dialog.

That said, your tests should be thread-safe. A unit test should be able to run in any order, in any environment, and always pass -- unless, of course, something changed in the code they're testing.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
  • I don't think that will help me, because I can't run more that one test settings file. So I imagined something like haveing two executions part in same test settings file where each of them where used by each different test list. But that is not possible too. – JerryA Apr 13 '12 at 14:39
  • BTW: I totally support your point with UnitTest but for now that will be too huge task. – JerryA Apr 13 '12 at 14:42