Skip to content

Commit

Permalink
Reduce Process test time (#44593)
Browse files Browse the repository at this point in the history
Fix a test that was taking 30 seconds, and make another test outerloop.
  • Loading branch information
stephentoub authored Nov 12, 2020
1 parent 2fc2311 commit 05ab615
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1877,6 +1877,7 @@ public void Process_StartInvalidNamesTest()
Assert.Throws<Win32Exception>(() => Process.Start("exe", string.Empty, new SecureString(), "thisDomain"));
}

[OuterLoop("May take many seconds the first time it's run")]
[Fact]
[PlatformSpecific(TestPlatforms.Windows)] // Starting process with authentication not supported on Unix
public void Process_StartWithInvalidUserNamePassword()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,17 +637,17 @@ public async Task WaitAsyncForSelfTerminatingChild()
}

[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
[OuterLoop("As written, takes 30 seconds")]
public async Task WaitAsyncForProcess()
{
Process p = CreateSleepProcess(WaitInMS);
p.Start();
Process p = CreateDefaultProcess();

Task processTask = p.WaitForExitAsync();
Task delayTask = Task.Delay(WaitInMS * 2);
Assert.False(p.HasExited);
Assert.False(processTask.IsCompleted);

p.Kill();
await processTask;

Task result = await Task.WhenAny(processTask, delayTask);
Assert.Equal(processTask, result);
Assert.True(p.HasExited);
}

Expand Down

0 comments on commit 05ab615

Please sign in to comment.