diff --git a/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs b/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs index 69f3a302f1d4a..020eb7cd9c672 100644 --- a/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs +++ b/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs @@ -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;