* Enable netfx testing. * Skip impacted tests and re-enable netfx testing. * Remove redundant comment. * Remove unnecessary project configuration. * Simplify test server copying.
15 lines
No EOL
487 B
C#
15 lines
No EOL
487 B
C#
namespace System.Diagnostics;
|
|
|
|
public static class ProcessExtensions
|
|
{
|
|
public static async Task WaitForExitAsync(this Process process, TimeSpan timeout)
|
|
{
|
|
#if NET
|
|
using var shutdownCts = CancellationTokenSource.CreateLinkedTokenSource(TestContext.Current.CancellationToken);
|
|
shutdownCts.CancelAfter(timeout);
|
|
await process.WaitForExitAsync(shutdownCts.Token);
|
|
#else
|
|
process.WaitForExit(milliseconds: (int)timeout.TotalMilliseconds);
|
|
#endif
|
|
}
|
|
} |