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

Most upvoted comments

I had the same problem, two workaround worked:

Adding --logger:"console;noprogress=true" like @tasadar2

However, I did not like it because I could not see the progress (--logger:"console" has same issue), so instead added < /dev/null

dotnet test .... < /dev/null

This allow me to see the progress of tests, without hanging.

image

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 latest mcr.microsoft.com/dotnet/core/sdk, currently b4c25c26dc73f498073fcdb4aefe167793eb3a8c79effa76df768006b5c345b8, 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

  • Our solution contains 10 test projects, each one has <IsTestProject>true</IsTestProject> set, and we are running dotnet test against the solution in a CircleCI environment.
  • When each test is run individually, everything works as intended.
  • When run locally, i see only 4 tests run at any time. And the local system only has 4 cpu cores.

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

@NicolasDorier thank you for finding your workaround. I can confirm it works, please see rabbitmq/rabbitmq-dotnet-client#750