-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Since SDK 2.2.300 test performance is magnitudes slower #2120
Comments
@davidruhmann does this repro on your local devbox as well? |
@davidruhmann Try separating the package restore and build from the test steps. you're doing all three in a single step that takes 27 seconds; I usually do something like the following: dotnet restore
dotnet build --no-restore
dotnet test --no-restore --no-build If you do this in distinct CirlceCI steps it will give you a more accurate reflection of where the time is being taken. |
@JSkimming separated steps as requested to show that dotnet test is super slow by itself. https://circleci.com/gh/davidruhmann/vstest2080/7 Note, this is just a repro of the issue, this is affecting production builds at the company I work with. Running hundreds of tests that should take seconds, take 5+ minutes on those projects. And only on versions of the SDK since 2.2.300. |
@ShreyasRmsft Yes, I can reproduce the issue locally with running tests in docker (with the TTY flag |
@davidruhmann I've created a PR (davidruhmann/vstest2080#3) to test against previous SDK releases, and I'm finding no real difference, certainly not on a different magnitude. |
@JSkimming Thank you for taking a look! I do see a difference both using docker and on CircleCI when using 2.2.204 vs 2.2.401. branch Docker CircleCI I will work on capture some screen recordings to show the issue visually. |
For some more context, here are more reports of this issue on CircleCI's board. |
@davidruhmann This looks a lot like the issue I had originally in CircleCI. Looking at the output, the step that takes 24 seconds reports to only take 1.5117 seconds. Starting test execution, please wait...
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.1 (64-bit .NET Core 4.6.27817.03)
Test run in progress.[xUnit.net 00:00:00.47] Discovering: Example.Library.Tests
Test run in progress.[xUnit.net 00:00:00.53] Discovered: Example.Library.Tests
Test run in progress.[xUnit.net 00:00:00.54] Starting: Example.Library.Tests
Test run in progress.[xUnit.net 00:00:00.69] Finished: Example.Library.Tests
Test run in progress. √ Example.Library.Tests.UnitTest1.Test2 [7ms]
Test run in progress. √ Example.Library.Tests.UnitTest1.Test5 [1ms]
Test run in progress. √ Example.Library.Tests.UnitTest1.Test3 [1ms]
Test run in progress. √ Example.Library.Tests.UnitTest1.Test4 [1ms]
Test run in progress. √ Example.Library.Tests.UnitTest1.Test1 [1ms]
Test run in progress.
Test Run Successful.
Total tests: 5
Passed: 5
Total time: 1.5117 Seconds
1>Done Building Project "/root/workspace/vstest2080.sln" (VSTest target(s)). The discrepancy when running in docker is strange, as I don't get that at all. What happens if you don't use |
@davidruhmann a further enhancement I was thinking about to #2024 was not to show the progress indicator if the environment variable Maybe you could investigate that as an option. |
@JSkimming Correct, if I do not use However, I would not categorize that as a resolution. |
So you think, not showing a progress indicator might fix the issue? |
Agreed, but it narrows down the potential causes, and I suspect the progress indicator is the culprit.
Yup, but I don't think it can be disabled using cli options. |
@JSkimming Thank you for the quick replies! Let me know if I can help diagnose it further. |
@davidruhmann I think you should consider submitting a PR as I did 😃 |
Just a suggestion, but a check for the environment variable being anything other than empty or |
That is an interesting thought. What constitutes the default. Normal Environment no
|
Personally I lean towards having invalid boolean value ignored. |
I was thinking that the convention of setting CI environment variable may not be followed well, say |
@JSkimming it is indeed strange that the progress indicator is causing slowness. Could it be that IO is bottlenecked? Just a thought. We will look into this. Thanks a lot for diagnosing the issue. |
This has regressed as per #2078 in the .NET Core 3.0 SDK since preview 7 as well. A test run in Travis CI that writes to the log that it takes 3 seconds to run the tests for takes about 15 minutes to complete. Again it appears that lots of time is being wasted writing Examples below using
Contrast with the same commit built in Azure DevOps and AppVeyor: |
Can workaround the issue by specifying the following parameter to
|
There is no progress indicator anymore. |
Description
Tests take a long time to run on detached hosts build servers (CircleCI)
Similar issue was closed, but the issue still happens. #2078
Steps to reproduce
Repo which can reproduce the issue https://github.com/davidruhmann/vstest2080
Expected behavior
Tests to complete
< 1s
Actual behavior
Tests take over
> 20s
Each line of
Test run in progress.
output takes several seconds while the test takes< 2 ms
.Diagnostic logs
https://circleci.com/gh/davidruhmann/vstest2080/3
Environment
The text was updated successfully, but these errors were encountered: