Avoid running Unit Test in parallel for all tests in one class

For performance reasons, I am running Unit Test in parallel. There are several classes where unit tests cannot run in parallel (I know this is problematic, but trying to find an intermediate solution).

Is there a way to set up tests to run in a class consistently across all tests in a solution?

+3


source to share


2 answers


Use xunit and turn off parallelism using

[assembly: CollectionBehavior(DisableTestParallelization = true)]

      



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

If you are using Microsoft.VisualStudio.QualityTools.UnitTestFramework

, have a look at this link to see how easy it is to jump to xunit Comparing xUnit.net to other platforms

+1


source


It looks like the setting is at the project level, so having two test projects with different settings might be an intermediate solution.



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

0


source







All Articles