diff --git a/TestCore/DistTest.cs b/TestCore/DistTest.cs index 3a970fd..9201a50 100644 --- a/TestCore/DistTest.cs +++ b/TestCore/DistTest.cs @@ -106,6 +106,11 @@ namespace CodexDistTests.TestCore activeService = client.CreateNamespacedService(serviceSpec, k8sNamespace); // todo: wait until online! + while (activeDeployment.Status.AvailableReplicas == null || activeDeployment.Status.AvailableReplicas != 1) + { + Timing.WaitForServiceDelay(); + activeDeployment = client.ReadNamespacedDeployment(activeDeployment.Name(), k8sNamespace); + } } public CodexNode GetCodexNode() @@ -123,6 +128,12 @@ namespace CodexDistTests.TestCore client.DeleteNamespace(activeNamespace.Name()); // todo: wait until terminated! + var pods = client.ListNamespacedPod(k8sNamespace); + while (pods.Items.Any()) + { + Timing.WaitForServiceDelay(); + pods = client.ListNamespacedPod(k8sNamespace); + } } } } diff --git a/TestCore/Timing.cs b/TestCore/Timing.cs index cca6dd5..89896f6 100644 --- a/TestCore/Timing.cs +++ b/TestCore/Timing.cs @@ -11,5 +11,10 @@ { Utils.Sleep(TimeSpan.FromSeconds(3)); } + + public static void WaitForServiceDelay() + { + Utils.Sleep(TimeSpan.FromSeconds(1)); + } } }