dotnet test seems to ignore runsettings MaxCpuCount
See original GitHub issueDescription
dotnet test
when run against a solution that contains multiple test projects, appears to spin up a parallel test runner for each test project.
Attempting to limit to one test runner at a time via the MaxCpuCount value in a .runsettings file doesn’t work.
Steps to reproduce
- Create a solution with two or more test projects that use NUnit
- Create a .runsettings file that sets MaxCpuCount=1
- run
dotnet test --settings pathtofile.runsettings
Expected behavior
Tests assemblies are run sequentially
Actual behavior
Test assemblies are run in parallel (seen in my case where the tests are database tests and they end up fighting for access to the database)
Diagnostic logs
Environment
Windows 10 1809, vstest.console 15.0.28307.421 .NET Core SDK 2.2.200/2.2.202
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Configure unit tests by using a .runsettings file
runsettings file. Select test settings file menu in Visual Studio 2019. The file appears on the Test menu, and you can select or...
Read more >runsettings test file values not being applied
I faced the same issue. For coded UI Tests please use timeout attribute in test method [Timeout(milliseconds)] public void DemoTest() { }.
Read more >"dotnet test -- RunSettings" doesn't pass settings to test
Create a new .Net Core MSTest Test Project. Set the test class to this: [TestClass] public class UnitTest1 { public TestContext TestContext { ......
Read more >Test Configuration with .NET Core and NUnit 3
Setting configuration using .runsettings files ... Select Test > Test Settings > Select Test Settings File and then select the .runsettings file.
Read more >Code coverage in .NET 5 with MSTest - Bart Simons
I only want my own application to be tested and with a runsettings file you can fix this. It supports regular expressions and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For anyone still looking for a solution, there is the command line option
-m:1
which specifies the maximum number of concurrent processes to use when building.Ref:
Even the fact that console loggers will be intermixed makes me want to run sequentially on CI to get sane output.
MaxCpuCount
is not a fix.Please reconsider reopening this.