From c816f6551da307f1cbc502ee1b90cf37768a8dab Mon Sep 17 00:00:00 2001 From: Ryan Campbell Date: Mon, 22 Jul 2024 16:50:00 +0000 Subject: [PATCH] updating pod check query --- test/integrationTests/Tests/DeploymentTest.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/integrationTests/Tests/DeploymentTest.cs b/test/integrationTests/Tests/DeploymentTest.cs index f46ae0a..ccc4bfa 100644 --- a/test/integrationTests/Tests/DeploymentTest.cs +++ b/test/integrationTests/Tests/DeploymentTest.cs @@ -134,12 +134,10 @@ void LinkResponseEventHandler(object? _, MessageFormats.HostServices.Link.LinkRe while (integrationPod == null && DateTime.Now <= maxTimeToWaitForDeployment) { result = await TestSharedContext.K8S_CLIENT.CoreV1.ListPodForAllNamespacesWithHttpMessagesAsync(allowWatchBookmarks: false, watch: false, pretty: true); podList = result.Body as k8s.Models.V1PodList ?? throw new Exception("Failed to get Pod List"); - integrationPod = podList.Items.FirstOrDefault(pod => pod.Name().Contains("integration-test", StringComparison.CurrentCultureIgnoreCase)); + integrationPod = podList.Items.FirstOrDefault(pod => pod.Name().Contains("integration-test", StringComparison.CurrentCultureIgnoreCase) && pod.Status.Phase == "Running"); Console.WriteLine($"...pod found: {integrationPod == null}"); - if ((integrationPod == null) || (integrationPod.Status.Phase == "Pending")) { - integrationPod = null; // Removing the pod since it's not done provisioning yet + if (integrationPod == null) await Task.Delay(5000); - } } if (integrationPod == null || integrationPod?.Status.Phase == "Pending") throw new TimeoutException($"Failed to find deployment after {TestSharedContext.MAX_TIMESPAN_TO_WAIT_FOR_MSG}. Please check that {TestSharedContext.TARGET_SVC_APP_ID} is deployed");