Skip to content

Commit

Permalink
Add retry loop around Process.Kill(entireProcessTree: true) (#102958)
Browse files Browse the repository at this point in the history
Workaround #93321
  • Loading branch information
jkotas committed Jun 1, 2024
1 parent f64701b commit cb71b60
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 cb71b60

Please sign in to comment.