From 4bf9b7055dd5c0b1851d73b085ed9a3805939a7b Mon Sep 17 00:00:00 2001 From: ta264 Date: Wed, 16 Oct 2019 21:24:36 +0100 Subject: [PATCH] Fixed: Make ProcessProvider tests more reliable --- src/NzbDrone.Common.Test/ProcessProviderFixture.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Common.Test/ProcessProviderFixture.cs b/src/NzbDrone.Common.Test/ProcessProviderFixture.cs index 8b8551ccc..ac136a933 100644 --- a/src/NzbDrone.Common.Test/ProcessProviderFixture.cs +++ b/src/NzbDrone.Common.Test/ProcessProviderFixture.cs @@ -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"); }