From 37a39d16248f7f2f3ae43957d401ad99046ca06e Mon Sep 17 00:00:00 2001 From: ta264 Date: Tue, 15 Oct 2019 21:45:41 +0100 Subject: [PATCH] Fixed: Make ProcessProvider tests more reliable --- src/NzbDrone.Common.Test/ProcessProviderTests.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Common.Test/ProcessProviderTests.cs b/src/NzbDrone.Common.Test/ProcessProviderTests.cs index 40270c198..2587d86ad 100644 --- a/src/NzbDrone.Common.Test/ProcessProviderTests.cs +++ b/src/NzbDrone.Common.Test/ProcessProviderTests.cs @@ -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"); }