vstest: Tests hang from dotnet test
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
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 7
- Comments: 42 (16 by maintainers)
Commits related to this issue
- Should fix issues with CircleCI See: https://github.com/microsoft/vstest/issues/2080 — committed to Sebazzz/Return by Sebazzz 5 years ago
- workaround for dotnet test hang ref https://github.com/microsoft/vstest/issues/2080#issuecomment-539879345 — committed to enricosada/Paket by deleted user 5 years ago
- Disable NSwag as this seems to cause flakiness in dotnet tests. See: * https://github.com/microsoft/vstest/issues/2080 * https://github.com/aspnet/AspNetCore/issues/3443 * https://github.com/micro... — committed to kwokkan/card-hero by kwokkan 5 years ago
- Disable NSwag as this seems to cause flakiness in dotnet tests. (#458) See: * https://github.com/microsoft/vstest/issues/2080 * https://github.com/aspnet/AspNetCore/issues/3443 * https://github... — committed to kwokkan/card-hero by kwokkan 5 years ago
- Try to fix test output on Travis CI Giving this a try: https://github.com/microsoft/vstest/issues/2080#issuecomment-539879345 — committed to rabbitmq/rabbitmq-dotnet-client by lukebakken 4 years ago
- Add Travis CI build configuration Try to fix test output on Travis CI Giving this a try: https://github.com/microsoft/vstest/issues/2080#issuecomment-539879345 — committed to rabbitmq/rabbitmq-dotnet-client by lukebakken 4 years ago
- Work around for build timeout See https://github.com/microsoft/vstest/issues/2080#issuecomment-539879345 — committed to alanta/Kontent.Wyam by alanta 4 years ago
- Workaround for https://github.com/microsoft/vstest/issues/2080 — committed to tgstation/tgstation-server by Cyberboss 4 years ago
I had the same problem, two workaround worked:
Adding
--logger:"console;noprogress=true"
like @tasadar2However, I did not like it because I could not see the progress (
--logger:"console"
has same issue), so instead added< /dev/null
This allow me to see the progress of tests, without hanging.
We are currently experiencing the same issue. We have been using
mcr.microsoft.com/dotnet/core/sdk:2.2.204
to avoid the performance degradation issue which is now resolved. But when attempting the latestmcr.microsoft.com/dotnet/core/sdk
, currentlyb4c25c26dc73f498073fcdb4aefe167793eb3a8c79effa76df768006b5c345b8
, only a couple test runs finish while the rest seem to hang. As with the performance issue, it seems to be related to non-interactive hosts.Situation
<IsTestProject>true</IsTestProject>
set, and we are runningdotnet test
against the solution in a CircleCI environment.Replication I condensed our project to share an example. Each test project has a single test that sleeps for 5sec. Repo: https://github.com/tasadar2/vstest-issue-2080 CircleCI: https://circleci.com/gh/tasadar2/vstest-issue-2080/3
It doesn’t always replicate the issue, but often does.
Can you file this issue on dotnet/aspnet
This helped us in case of IHostedService: https://www.strathweb.com/2021/05/the-curious-case-of-asp-net-core-integration-test-deadlock/
@NicolasDorier thank you for finding your workaround. I can confirm it works, please see rabbitmq/rabbitmq-dotnet-client#750