I've recently migrated ~2000 pure unit tests from MSTest to XUnit. The tests are contained in approximately 10 tests projects and are configured to run in parallel by test collection and assembly. I've installed the visual studio test runner nuget package and when running locally in Visual Studio 2017 the tests take ~25s to complete. However, the tests take ~30 minutes (!) when they are run on a VSTS build agent. I've tried tuning all the various flags in xunit to try and speed up the tests on the build agent but the best runtime I've managed to achieve is ~20 minutes. Has anyone else experienced such a massive discrepancy between xunit test runtimes?
1
votes
Do you use Hosted or private agent? Do they have the same issue? Can you post the detail log here? You may just run part of them to narrow down which tests take too long time to run.
– starian chen-MSFT
It's a private agent, hosted on an Azure VM. I managed to resolve the issue by updating the xunit nuget packages to the latest BETA version (v2.3.0-beta3-build3705) which has reduced the unit test runtime on the agent to a reasonable 60s. I've not found any documentation online relating to the improved performance in the latest release.
– ASH
Yes it appears to be solved after updating the xunit packages to the latest Betas.
– ASH