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

DotNetCoreCLI@2's dotnet test hangs indefinitely when a child process inherited the STDIO streams and has not yet exited #17548

Open
ChristoWolf opened this issue Jan 2, 2023 · 8 comments
Assignees
Labels
Area: ABTT Akvelon Build Tasks Team area of work bug Task: DotNetCoreCLI

Comments

@ChristoWolf
Copy link

Required Information

Question, Bug, or Feature?
Type: Bug

Enter Task Name: DotNetCoreCLI@2

Environment

  • Server: Azure DevOps Server 2020
  • Agent: Private, Windows 10 20H2, agent v2.213.2

Issue Description

Instead of showing the current execution time as usual, executing the test command via the DotNetCoreCLI@2 task shows 100% while hanging indefinitely (until the configured timeout triggers), and not traces of the log can be found anywhere (there are bits and pieces of the log in the agent's _diag/pages folder, but nothing complete).

This happens when a child process of dotnet locks its IO stream(s), and dotnet test reports

The STDIO streams did not close within 10 seconds of the exit event from process 'C:\agent\_work\_tool\dotnet\dotnet.exe'. This may indicate a child process inherited the STDIO streams and has not yet exited.

Task logs

N/A

@ChristoWolf
Copy link
Author

ChristoWolf commented Feb 16, 2023

I cannot verify this currently, but this might be fixed by this agent bug fix.

@BoutemineOualid
Copy link

Same issue here.

Viir added a commit to pine-vm/pine that referenced this issue Jul 2, 2023
With the previous version, Azure Pipeline sometimes failed the execution of the tests, not completing the test step.
Looking into these failures, I also found the following message in the logs from Azure Pipelines:

> The STDIO streams did not close within 10 seconds of the exit event from process 'C:\hostedtoolcache\windows\dotnet\dotnet.exe'. This may indicate a child process inherited the STDIO streams and has not yet exited.

For discussions of the problem, see also:

+ microsoft/azure-pipelines-tasks#17548
+ microsoft/azure-pipelines-tasks#13033
+ microsoft/azure-pipelines-tasks#18476
Viir added a commit to pine-vm/pine that referenced this issue Jul 2, 2023
With the previous version, Azure Pipeline sometimes failed the execution of the tests, not completing the test step.
Looking into these failures, I also found the following message in the logs from Azure Pipelines:

> The STDIO streams did not close within 10 seconds of the exit event from process 'C:\hostedtoolcache\windows\dotnet\dotnet.exe'. This may indicate a child process inherited the STDIO streams and has not yet exited.

For discussions of the problem, see also:

+ microsoft/azure-pipelines-tasks#17548
+ microsoft/azure-pipelines-tasks#13033
+ microsoft/azure-pipelines-tasks#18476
Viir added a commit to pine-vm/pine that referenced this issue Jul 2, 2023
With the previous version, Azure Pipeline sometimes failed the execution of the tests, not completing the test step.
Looking into these failures, I also found the following message in the logs from Azure Pipelines:

> The STDIO streams did not close within 10 seconds of the exit event from process 'C:\hostedtoolcache\windows\dotnet\dotnet.exe'. This may indicate a child process inherited the STDIO streams and has not yet exited.

For discussions of the problem, see also:

+ microsoft/azure-pipelines-tasks#17548
+ microsoft/azure-pipelines-tasks#13033
+ microsoft/azure-pipelines-tasks#18476
@sona-jain
Copy link

I am hitting same issue. What circumstances make it hang?

@NorbertNemec
Copy link

I'm experiencing a very similar issue with a different task (in my case https://www.unitydevops.com/) - the problem here is that Unity.exe - a complex program outside our control - leaves some child processed alive when it exists cleanly. The executable cleanly ends with Exit Code 0 but then Azure Pipelines still waits indefinitely until it times out and considers the task failed.

Unfortunately, Azure Pipelines offers not info about which child process is still running and offers no means to kill the child processes. Following some discussion on various forums, I would even have assumed that it should kill child processes by default and provide some info (error?) about that.

@maranmaran
Copy link

Finding same issues with Specflow and chrome driver staying active.

@ChristoWolf
Copy link
Author

Hi @rvairavelu!

Are there any news regarding this issue?

@KonstantinTyukalov KonstantinTyukalov added Area: ABTT Akvelon Build Tasks Team area of work Task: DotNetCoreCLI and removed Area: Release labels Mar 27, 2024
@GabrielHSFerreira
Copy link

Hi guys.

Having same problem here when running multiple test projects. Any workarounds available?

@GabrielHSFerreira
Copy link

Is it the same problem reported on dotnet/sdk#27106 and dotnet/sdk#9452?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: ABTT Akvelon Build Tasks Team area of work bug Task: DotNetCoreCLI
Projects
None yet
Development

No branches or pull requests

8 participants