mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 04:59:35 -07:00
Fixed: Make ProcessProvider tests more reliable
This commit is contained in:
parent
6803ef960d
commit
4bf9b7055d
1 changed files with 8 additions and 1 deletions
|
@ -72,6 +72,8 @@ namespace NzbDrone.Common.Test
|
||||||
{
|
{
|
||||||
var process = StartDummyProcess();
|
var process = StartDummyProcess();
|
||||||
|
|
||||||
|
Thread.Sleep(500);
|
||||||
|
|
||||||
var check = Subject.GetProcessById(process.Id);
|
var check = Subject.GetProcessById(process.Id);
|
||||||
check.Should().NotBeNull();
|
check.Should().NotBeNull();
|
||||||
|
|
||||||
|
@ -90,6 +92,8 @@ namespace NzbDrone.Common.Test
|
||||||
{
|
{
|
||||||
var process = StartDummyProcess();
|
var process = StartDummyProcess();
|
||||||
|
|
||||||
|
Thread.Sleep(500);
|
||||||
|
|
||||||
Subject.Exists(DummyApp.DUMMY_PROCCESS_NAME).Should()
|
Subject.Exists(DummyApp.DUMMY_PROCCESS_NAME).Should()
|
||||||
.BeTrue("expected one dummy process to be already running");
|
.BeTrue("expected one dummy process to be already running");
|
||||||
|
|
||||||
|
@ -101,6 +105,7 @@ namespace NzbDrone.Common.Test
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
[Retry(3)]
|
||||||
[Platform(Exclude="MacOsX")]
|
[Platform(Exclude="MacOsX")]
|
||||||
[Retry(3)]
|
[Retry(3)]
|
||||||
public void kill_all_should_kill_all_process_with_name()
|
public void kill_all_should_kill_all_process_with_name()
|
||||||
|
@ -108,6 +113,8 @@ namespace NzbDrone.Common.Test
|
||||||
var dummy1 = StartDummyProcess();
|
var dummy1 = StartDummyProcess();
|
||||||
var dummy2 = StartDummyProcess();
|
var dummy2 = StartDummyProcess();
|
||||||
|
|
||||||
|
Thread.Sleep(500);
|
||||||
|
|
||||||
Subject.KillAll(DummyApp.DUMMY_PROCCESS_NAME);
|
Subject.KillAll(DummyApp.DUMMY_PROCCESS_NAME);
|
||||||
|
|
||||||
dummy1.HasExited.Should().BeTrue();
|
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");
|
Assert.Fail("Failed to start process within 2 sec");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue