Fixed: Make ProcessProvider tests more reliable

This commit is contained in:
ta264 2019-10-16 21:24:36 +01:00 committed by Qstick
parent 6803ef960d
commit 4bf9b7055d
1 changed files with 8 additions and 1 deletions

View File

@ -72,6 +72,8 @@ namespace NzbDrone.Common.Test
{
var process = StartDummyProcess();
Thread.Sleep(500);
var check = Subject.GetProcessById(process.Id);
check.Should().NotBeNull();
@ -90,6 +92,8 @@ namespace NzbDrone.Common.Test
{
var process = StartDummyProcess();
Thread.Sleep(500);
Subject.Exists(DummyApp.DUMMY_PROCCESS_NAME).Should()
.BeTrue("expected one dummy process to be already running");
@ -101,6 +105,7 @@ namespace NzbDrone.Common.Test
[Test]
[Retry(3)]
[Platform(Exclude="MacOsX")]
[Retry(3)]
public void kill_all_should_kill_all_process_with_name()
@ -108,6 +113,8 @@ namespace NzbDrone.Common.Test
var dummy1 = StartDummyProcess();
var dummy2 = StartDummyProcess();
Thread.Sleep(500);
Subject.KillAll(DummyApp.DUMMY_PROCCESS_NAME);
dummy1.HasExited.Should().BeTrue();
@ -126,7 +133,7 @@ namespace NzbDrone.Common.Test
}
});
if (!processStarted.Wait(2000))
if (!processStarted.Wait(5000))
{
Assert.Fail("Failed to start process within 2 sec");
}