Skip to content

Commit

Permalink
Add retry loop around Process.Kill(entireProcessTree: true)
Browse files Browse the repository at this point in the history
Workaround dotnet#93321
  • Loading branch information
jkotas committed Jun 1, 2024
1 parent 9db5486 commit a7993bb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,18 @@ static bool CollectCrashDumpWithCreateDump(Process process, string crashDumpPath
}
else
{
createdump.Kill(true);
// Workaround for https://github.com/dotnet/runtime/issues/93321
for (int i = 0; i < 5; i++)
{
try
{
createdump.Kill(entireProcessTree: true);
}
catch (Exception e)
{
Console.WriteLine($"Process.Kill(entireProcessTree: true) failed with {e}. Retrying.");
}
}
}

return fSuccess && createdump.ExitCode == 0;
Expand Down

0 comments on commit a7993bb

Please sign in to comment.