-
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
Tests hang from dotnet test #2080
Comments
@JamesNK , if this is an intermediate issue, can you please enable diagnostics logs for testplatform & share those with us https://github.com/Microsoft/vstest-docs/blob/master/docs/diagnose.md |
I can't easily get logs off the build server but I can repo freezing on my dev machine with this. It freezes all the time within 5 minutes:
|
This is an ongoing problem. I'd like to make some progress on fixing it. Do you need anymore information from me? |
@JamesNK I went through the logs & from the logs I didn't see any hang state. The only interesting thing I observed was that it seemed we start 10 different testhost processes in sequence, but you have shared logs for 30 testhost process. Can you please share how many test dlls are you running ? |
Because I'm doing it in a loop: In the example of the logs I attached it freezes after 3 runs. Have you tried reproing it? |
I'm looking into it, I've cloned the repo, & all I need to do is run dotnet on sln right? |
I tried it locally multiple times, but it did not repro for me. |
We are currently experiencing the same issue. We have been using Situation
Replication It doesn't always replicate the issue, but often does. |
|
Still appears to be an issue. |
I've narrowed down my hanging issue. It is caused by something with how vstest writes to the console. If no tests fail then vstest completes without any problems. If a test fails then vstest hangs until the CI build times out (this is in Travis CI) The workaround I am using is to write the test output to a text file, and the write the text file to console. If I do that then it never hangs. |
@JamesNK What is the dotnet sdk version you are using ? Can you share the link to the CI ? |
Looks like this is still an issue on the recent 3.0. |
@tasadar2 Can you please try to use --logger:console;noprogress=true argument and check the issue reproduces for you ? |
That arg produces the same results, https://app.circleci.com/jobs/github/tasadar2/vstest-issue-2080/11 |
Though, when quoting the argument value, that seems to work |
I had the same problem, two workaround worked: Adding However, I did not like it because I could not see the progress (
This allow me to see the progress of tests, without hanging. |
Full logs of a successful build with feedback https://circleci.com/gh/dgarage/NBXplorer/430 before the hack you can see things stalling https://circleci.com/gh/dgarage/NBXplorer/409 Happening on mcr.microsoft.com/dotnet/core/sdk:3.0.100 |
I had this problem with a small vm (2 cores, 2GB ram), increasing to 8cores and 8gb ram make it work. I read at some place that this was thread related so I came up with the more cores idea. The |
Not sure if it's related. I'm also a GitLab user and found a very similar problem so I suspect it's probably related to the SDK image, but in my case happens with I have also checked whether it has anything to do with async calls in case there is a deadlock, but I seem to be awaiting properly everywhere. |
Out of curiosity, is anybody experiencing this only when using |
@diegosasw, for me it's happening when using dotnet test on a solution file even if there is no IHostedService usage. |
This helped us in case of IHostedService: |
@Evangelink @davidfowl Even on our very powerful Macbook pros, when we are running one of our integration test projects that has hundreds of tests, many of which use We set xunit to use unlimited amount of threads (-1), we have overridden a bunch of xunit stuff to implement a semaphore to limit the number of concurrent tests. https://github.com/dotnet/aspnetcore/blob/main/src/Hosting/TestHost/src/TestServer.cs#L101 Can this be the root cause for all our deadlocks only in Unit tests problems? |
Can you file this issue on dotnet/aspnet |
Your request is my command: dotnet/aspnetcore#43353 |
just in case this helps someone, at a random time this line started randomly hanging our tests _task = Task.Factory.StartNew(async () => |
@cvpoienaru Please investigate this issue. |
Did anything happen in the investigation by chance? |
I am experiencing the same when using TestServer. I've tried to stop all the Could I know how are you troubleshooting this? The only workaround i have is to set
in the test assembly, so that it runs sequentially in CI/CD pipeline. |
@cvpoienaru Please investigate this issue. |
This issue is still unresolved. |
This issue is a mix of different problems, some related to other products, but I did not find a clear repro. If someone is still experiencing this problem and has a simple repro, please file a new issue. |
Steps to reproduce
Tests run on travis CI via
dotnet test
now intermittently fail. Failures started after updating to a newer .NET Core SDK. It appears that the test tool increased from 16.0.1 to 16.1.1 with the new SDK.Source code: https://github.com/grpc/grpc-dotnet/commits/master
Expected behavior
Tests run and exit
Actual behavior
Tests hang and the build is terminated
Diagnostic logs
Failure: https://travis-ci.org/grpc/grpc-dotnet/builds/551562232?utm_source=github_status&utm_medium=notification
Microsoft (R) Test Execution Command Line Tool Version 16.1.1
Success: https://travis-ci.org/grpc/grpc-dotnet/builds/551058627?utm_source=github_status&utm_medium=notification
Microsoft (R) Test Execution Command Line Tool Version 16.0.1
The text was updated successfully, but these errors were encountered: