PARALLEL_TEST_EXECUTION.md
This workspace is configured to run all three test projects in parallel in Visual Studio Test Explorer.
.runsettings (Solution Root)MaxCpuCount=0 uses all available processors to run test assemblies in parallelDisableParallelization=false ensures parallelization is enabledxunit.runner.json (In Each Test Project)Each test project contains an xunit.runner.json file with:
parallelizeAssembly: true - Allows tests from this assembly to run in parallel with other assembliesparallelizeTestCollections: true - Runs test collections within the assembly in parallelmaxParallelThreads: 0 - Uses xUnit's default algorithm (processors 2).runsettings file at the solution root.runsettings fileVisual Studio will automatically detect and use .runsettings in the solution root in most cases.
After configuration, when you run all tests:
Recommended for:
Use with caution for:
If you encounter issues with FunctionalTests (which use Testcontainers), you may need to:
parallelizeAssembly: false in its xunit.runner.jsonTo disable parallel execution for a specific test project, update its xunit.runner.json:
{
"shadowCopy": false,
"parallelizeAssembly": false,
"parallelizeTestCollections": false
}
To use the .runsettings file when running tests from the command line:
dotnet test --settings .runsettings