From 43296c759a6f9ec6afc15b36caa81eee166dd940 Mon Sep 17 00:00:00 2001 From: ta264 Date: Wed, 12 May 2021 22:08:34 +0100 Subject: [PATCH] Don't start integration tests too soon (cherry picked from commit 47d10d8d0922e3eaadf9898bb22dc2b71b1b17d5) --- src/NzbDrone.Integration.Test/IntegrationTest.cs | 3 +++ src/NzbDrone.Integration.Test/IntegrationTestBase.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/NzbDrone.Integration.Test/IntegrationTest.cs b/src/NzbDrone.Integration.Test/IntegrationTest.cs index 7ec027ef0..3b64124b8 100644 --- a/src/NzbDrone.Integration.Test/IntegrationTest.cs +++ b/src/NzbDrone.Integration.Test/IntegrationTest.cs @@ -1,6 +1,7 @@ using System.Threading; using NLog; using NUnit.Framework; +using NzbDrone.Common.Extensions; using NzbDrone.Core.Indexers.FileList; using NzbDrone.Test.Common; using Prowlarr.Http.ClientSchema; @@ -34,6 +35,8 @@ namespace NzbDrone.Integration.Test protected override void InitializeTestTarget() { + WaitForCompletion(() => Tasks.All().SelectList(x => x.TaskName).Contains("CheckHealth")); + Indexers.Post(new Prowlarr.Api.V1.Indexers.IndexerResource { Enable = false, diff --git a/src/NzbDrone.Integration.Test/IntegrationTestBase.cs b/src/NzbDrone.Integration.Test/IntegrationTestBase.cs index ed21f89e7..c7f1b46a2 100644 --- a/src/NzbDrone.Integration.Test/IntegrationTestBase.cs +++ b/src/NzbDrone.Integration.Test/IntegrationTestBase.cs @@ -16,6 +16,7 @@ using NzbDrone.SignalR; using NzbDrone.Test.Common.Categories; using Prowlarr.Api.V1.Config; using Prowlarr.Api.V1.History; +using Prowlarr.Api.V1.System.Tasks; using Prowlarr.Api.V1.Tags; using RestSharp; using RestSharp.Serializers.SystemTextJson; @@ -28,6 +29,7 @@ namespace NzbDrone.Integration.Test protected RestClient RestClient { get; private set; } public CommandClient Commands; + public ClientBase Tasks; public ClientBase History; public ClientBase HostConfig; public IndexerClient Indexers; @@ -83,6 +85,7 @@ namespace NzbDrone.Integration.Test RestClient.UseSystemTextJson(); Commands = new CommandClient(RestClient, ApiKey); + Tasks = new ClientBase(RestClient, ApiKey, "system/task"); History = new ClientBase(RestClient, ApiKey); HostConfig = new ClientBase(RestClient, ApiKey, "config/host"); Indexers = new IndexerClient(RestClient, ApiKey);