Skip to content
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

"dotnet build" hangs when called from test #42821

Open
taori opened this issue Aug 17, 2024 · 1 comment
Open

"dotnet build" hangs when called from test #42821

taori opened this issue Aug 17, 2024 · 1 comment
Labels
Area-Linux untriaged Request triage from a team member

Comments

@taori
Copy link

taori commented Aug 17, 2024

Describe the bug

Adding a little context here because it will be needed to understand:

I am developing this: https://github.com/taori/Amusoft.DotnetNew.Tests
A project which allows the testing of templates which can be used with dotnet new.

Unfortunately at the stage where i got to testing the execution of dotnet build on the scaffolded project that process will end up hanging in CI (github actions). I tried reproducing the cause of it when running dotnet test on a windows 11 host (my own machine), an ubuntu VM and initially thought that it is in an ubuntu issue, but the first run of the tests on ubuntu VM just took longer ( a couple minutes instead of 15~seconds), then finished just as fast on windows for consecutive runs.

I am unable to figure out why this does not work, but i would be happy if anyone has any ideas.

from a process pov what is happening is: dotnet test is running multiple processes

  • dotnet new install
  • dotnet new {tempate creation}
  • dotnet restore
  • dotnet build <!-----

I went through a couple approaches to try fix it:

  • changing CI to windows-latest - same issue
  • removing VerifyTests (in case it spins up a svn compare prompt for some reason) - same issue
  • removing CliWrap (in case it spins up process in a way that can cause a blocked process) - same issue
  • looking at the dump generated by "dotnet test ... --blame-hang-timeout" (i don't think i know how to properly look at a dump, to see why it was stuck, at least it complained about not being able to inspect values in a minidump, and the CLI says a full dump is the default)

note that it works just fine both on ubuntu VM + win11 host.

I am uncertain at this stage on whether the issue is github actions or dotnet build in some way.

If the culprit is github actions i don't understand why it hung on ubuntu VM for the first run for like 15 minutes (that makes it sound like a potential ubuntu issue, which in a CI env could happen loads, since i don't know which build agent i will get)
if the culprit is dotnet build - why does it work just fine on my machine, but fails in github actions?

Any pointers to dig deeper myself are welcome, too. I can also provide dumps if that helps.

To Reproduce

Exceptions (if any)

Further technical details

  • dotnet info in CI can vary
  • no IDE used. it happens in CI
@gimlichael
Copy link

gimlichael commented Sep 13, 2024

Seems related: dotnet/core#9496 (comment)

Did you find a solution to your problem?
For me it only happens in GitHub Actions && Ubuntu && .NET9 RC1.

I created an issue here (maybe they are related): #43432

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Linux untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

2 participants