โก Parallel & Sequential Execution โ
Prova allows you to control how tests are executed using concurrency attributes at the Class or Assembly level.
๐ Parallel Execution โ
By default, Prova runs tests in parallel, capped at the number of processors on your machine. You can explicitly control this behavior.
At the Class Level โ
Use [Parallel(n)] to limit the number of concurrent tests within a specific class.
[Parallel(2)] // Max 2 tests in this class will run at once
public class MyTests { ... }Use [Parallel] (without arguments) to indicate that the class has no specific concurrency limits and should use the global runner default.
At the Assembly Level โ
Apply [Parallel(n)] to your assembly (usually in AssemblyInfo.cs or any file) to set the global default concurrency for the entire test runner.
[assembly: Parallel(16)]๐งต Sequential Execution โ
If your tests are sensitive to shared state or timing, you can force them to run one at a time.
At the Class Level โ
Use [Sequential] to ensure all tests in the class run serially.
[Sequential]
public class IntegrationTests
{
[Fact]
public void TestA() { ... }
[Fact]
public void TestB() { ... } // Will wait for TestA to finish
}At the Assembly Level โ
Force the entire test suite to run sequentially by applying it to the assembly.
[assembly: Sequential]๐ Resource Constraints โ
For even finer control, use [NotInParallel] to prevent specific tests from running alongside others that use the same shared resource (e.g., a Database or File).
public class ResourceTests
{
[Fact]
[NotInParallel("Database")]
public void Test1() { ... }
[Fact]
[NotInParallel("Database")]
public void Test2() { ... } // Will not run at the same time as Test1
}TIP
Use [DoNotParallelize] to mark a test that must run in complete isolation from ALY other tests.