1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

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

View File

@ -66,10 +66,13 @@ public void GetProcessById_should_return_null_for_invalid_process(int processId)
}
[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 @@ public void exists_should_find_running_process()
{
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 @@ public void Should_be_able_to_start_python()
}
[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 @@ private Process StartDummyProcess()
}
});
if (!processStarted.Wait(2000))
if (!processStarted.Wait(5000))
{
Assert.Fail("Failed to start process within 2 sec");
}