question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests hang from dotnet test

See original GitHub 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

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:7
  • Comments:42 (16 by maintainers)

github_iconTop GitHub Comments

11reactions
NicolasDoriercommented, Oct 9, 2019

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

3reactions
tasadar2commented, Jul 11, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Howto resolve .net test hangs on "Starting test execution ...
Sometimes xUnit tests hang forever because the test runner pipeline can't handle parallel threads. To check if that's the issue try adding xunit ......
Read more >
.Net (DotNet) tests get stuck with no reported errors or ...
Regarding the parameter --blame-hang-timeout 15min I noticed that it did not have any effect. The test continued stuck for more than 15 minutes ......
Read more >
Generating a dump file when tests hang on a CI machine
dotnet test has many useful options. One of them is --blame-hang which creates a dump of the process and all the child processes...
Read more >
Tracking down a hanging xUnit test in CI: building a custom ...
In this post I describe how we tracked down a hanging xUnit test by building a custom XuniTestFramework implementation.
Read more >
dotnet test command - .NET CLI
The dotnet test command is used to execute unit tests in a given ... Run the tests in blame mode and collects a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found