From 47bf4bf48bb1c19648098897a457555962bb4ab0 Mon Sep 17 00:00:00 2001 From: benbierens Date: Mon, 20 Mar 2023 08:13:19 +0100 Subject: [PATCH] Fixes mistake in WaitUntilOnline method --- TestCore/K8sManager.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/TestCore/K8sManager.cs b/TestCore/K8sManager.cs index e190340..9235463 100644 --- a/TestCore/K8sManager.cs +++ b/TestCore/K8sManager.cs @@ -84,9 +84,11 @@ namespace CodexDistTests.TestCore private void WaitUntilOnline(ActiveNode activeNode, Kubernetes client) { - WaitUntil(() => - activeNode.Deployment?.Status.AvailableReplicas != null && - activeNode.Deployment.Status.AvailableReplicas > 0); + WaitUntil(() => + { + activeNode.Deployment = client.ReadNamespacedDeployment(activeNode.Deployment.Name(), k8sNamespace); + return activeNode.Deployment?.Status.AvailableReplicas != null && activeNode.Deployment.Status.AvailableReplicas > 0; + }); } private void WaitUntilOffline(string deploymentName, Kubernetes client) @@ -100,14 +102,12 @@ namespace CodexDistTests.TestCore private void WaitUntilZeroPods(Kubernetes client) { - WaitUntil(() => - !client.ListNamespacedPod(k8sNamespace).Items.Any()); + WaitUntil(() => !client.ListNamespacedPod(k8sNamespace).Items.Any()); } private void WaitUntilNamespaceDeleted(Kubernetes client) { - WaitUntil(() => - client.ListNamespace().Items.All(n => n.Metadata.Name != k8sNamespace)); + WaitUntil(() => client.ListNamespace().Items.All(n => n.Metadata.Name != k8sNamespace)); } private void WaitUntil(Func predicate)