Fixed: Make ProcessProvider tests more reliable

This commit is contained in:
ta264 2019-10-15 21:45:41 +01:00 committed by Qstick
parent 9fe978319e
commit 37a39d1624
1 changed files with 9 additions and 1 deletions

View File

@ -66,10 +66,13 @@ namespace NzbDrone.Common.Test
}
[Test]
[Retry(3)]
public void should_be_able_to_start_process()
{
var process = StartDummyProcess();
Thread.Sleep(500);
var check = Subject.GetProcessById(process.Id);
check.Should().NotBeNull();
@ -88,6 +91,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");
@ -147,12 +152,15 @@ namespace NzbDrone.Common.Test
}
[Test]
[Retry(3)]
[Platform(Exclude="MacOsX")]
public void kill_all_should_kill_all_process_with_name()
{
var dummy1 = StartDummyProcess();
var dummy2 = StartDummyProcess();
Thread.Sleep(500);
Subject.KillAll(DummyApp.DUMMY_PROCCESS_NAME);
dummy1.HasExited.Should().BeTrue();
@ -181,7 +189,7 @@ namespace NzbDrone.Common.Test
}
});
if (!processStarted.Wait(2000))
if (!processStarted.Wait(5000))
{
Assert.Fail("Failed to start process within 2 sec");
}