Description
Usage Information
Any
Description
Process execution timeout does not kill the whole process tree. My use case is the timeout for the "dotnet test". This process spawns the child process; when timeout happens, only the main process is killed.
Reproduction Steps
running dotnet test for net4.8 framework; Add Thread.Sleep in tests more than and Timeout in nuke build; After timeout observe orphan processes left in "procexp" tool
Expected Behavior
No orphan processes are left
Actual Behavior
Only the parent process is killed
Regression?
Nope.
Known Workarounds
netstandart2.0 examples
https://github.com/dotnet/msbuild/blob/vs15.9/src/Utilities/ProcessExtensions.cs
https://raw.githubusercontent.com/dotnet/cli/master/test/Microsoft.DotNet.Tools.Tests.Utilities/Extensions/ProcessExtensions.cs
Latest Microsoft solution
https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.kill?view=net-8.0#remarks
Could you help with a pull-request?
Yes