diff --git a/src/NzbDrone.Integration.Test/ApiTests/MovieEditorFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/MovieEditorFixture.cs index ab8e1eb0d..c3f05e5fb 100644 --- a/src/NzbDrone.Integration.Test/ApiTests/MovieEditorFixture.cs +++ b/src/NzbDrone.Integration.Test/ApiTests/MovieEditorFixture.cs @@ -11,6 +11,8 @@ public class MovieEditorFixture : IntegrationTest { private void GivenExistingMovie() { + WaitForCompletion(() => Profiles.All().Count > 0); + foreach (var title in new[] { "The Dark Knight", "Pulp Fiction" }) { var newMovie = Movies.Lookup(title).First(); diff --git a/src/NzbDrone.Integration.Test/IntegrationTest.cs b/src/NzbDrone.Integration.Test/IntegrationTest.cs index b81470417..062f07602 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.Newznab; using NzbDrone.Test.Common; using Radarr.Http.ClientSchema; @@ -34,6 +35,9 @@ protected override void StartTestTarget() protected override void InitializeTestTarget() { + // Make sure tasks have been initialized so the config put below doesn't cause errors + WaitForCompletion(() => Tasks.All().SelectList(x => x.TaskName).Contains("RssSync")); + Indexers.Post(new Radarr.Api.V3.Indexers.IndexerResource { EnableRss = false, diff --git a/src/NzbDrone.Integration.Test/IntegrationTestBase.cs b/src/NzbDrone.Integration.Test/IntegrationTestBase.cs index 116c27cd5..67b0857a0 100644 --- a/src/NzbDrone.Integration.Test/IntegrationTestBase.cs +++ b/src/NzbDrone.Integration.Test/IntegrationTestBase.cs @@ -25,6 +25,7 @@ using Radarr.Api.V3.Movies; using Radarr.Api.V3.Profiles.Quality; using Radarr.Api.V3.RootFolders; +using Radarr.Api.V3.System.Tasks; using Radarr.Api.V3.Tags; using RestSharp; @@ -37,6 +38,7 @@ public abstract class IntegrationTestBase public ClientBase Blacklist; public CommandClient Commands; + public ClientBase Tasks; public DownloadClientClient DownloadClients; public ClientBase History; public ClientBase HostConfig; @@ -98,6 +100,7 @@ protected virtual void InitRestClients() Blacklist = new ClientBase(RestClient, ApiKey); Commands = new CommandClient(RestClient, ApiKey); + Tasks = new ClientBase(RestClient, ApiKey, "system/task"); DownloadClients = new DownloadClientClient(RestClient, ApiKey); History = new ClientBase(RestClient, ApiKey); HostConfig = new ClientBase(RestClient, ApiKey, "config/host");