4

For performance reason I execute the Unit Test in parallel. There are several classes in which Unit Tests cannot be executed in parallel (I know that this is problematic but trying to find an intermediate solution).

Is there a way to configure to execute tests in a class sequentially while running all tests in solution?

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
Arieltk
  • 121
  • 2
  • 9
  • Which version of Visual Studio / MsTest? – jessehouwing Jun 29 '15 at 11:16
  • Does this answer your question? [MSTest executing all my tests simultaneously breaks tests - what to do](https://stackoverflow.com/questions/700043/mstest-executing-all-my-tests-simultaneously-breaks-tests-what-to-do) – Michael Freidgeim Nov 12 '20 at 19:19

2 Answers2

0

It looks like the setting is on project level, so having two test projects with different setting would perhaps be a intermediate solution.

https://msdn.microsoft.com/en-us/library/ee921484(v=vs.100).aspx

Jocke
  • 2,189
  • 1
  • 16
  • 24
0

Use xunit and turn off the parallelism using

[assembly: CollectionBehavior(DisableTestParallelization = true)]

in the AssemblyInfo.cs file of your unit test project.

If you are using Microsoft.VisualStudio.QualityTools.UnitTestFramework checkout this link to see how easy is to migrate to xunit Comparing xUnit.net to other frameworks