I am helping with a big codebase, and I found that [TestMethod]
executions might interferer with each other if they run in parallel. I know that this is a bad practice.
Is there any way (like a C# attribute) to prevent parallel execution of all tests in a [TestClass]
?
The tests are running automated in a few environments, including Azure DevOps. I am looking for a way to solve this matter in c# code and avoid using settings depends on the test runner.
Update and clarification #1
I know we have questions like this one dated back in 2009:
MSTest executing all my tests simultaneously breaks tests - what to do
Fast forward 11 years to 2020, I expect visual studio product family is a diffrent thing with the same name.
Update and clarification #2
This is not an NUnit question. The lazer forcus of this question is MStest.
Update and clarification #3
Please note that this is a product (MSTest) specific question. I know there are many similar questions related NUnit etc. or older version of Visual Studio.
As we know Visual Studio 2019 introduced many testing improvements. That is what I am asking.