diff --git a/Turkey.Tests/ProcessExtensionsTest.cs b/Turkey.Tests/ProcessExtensionsTest.cs index 047852b..f6e870d 100644 --- a/Turkey.Tests/ProcessExtensionsTest.cs +++ b/Turkey.Tests/ProcessExtensionsTest.cs @@ -37,17 +37,10 @@ public async Task WaitForExitAsync_DoesNotHangForOrphanedGrandChildren() using Process process = Process.Start(psi); // Use a shorter timeout for WaitForExitAsync than the grandchild lives. - Stopwatch stopWatch = new Stopwatch(); - stopWatch.Start(); using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(WaitTimeoutSeconds)); // The WaitForExit completes by cancellation. await Assert.ThrowsAsync(() => process.WaitForExitAsync(cts.Token, new StringWriter(), new StringWriter())); - - // The completion takes at least the WaitTime. - stopWatch.Stop(); - TimeSpan elapsedTime = stopWatch.Elapsed; - Assert.True(elapsedTime >= TimeSpan.FromSeconds(WaitTimeoutSeconds), "The grandchild is not keeping the script alive"); } finally {