Skip to content

Commit

Permalink
updating pod check query
Browse files Browse the repository at this point in the history
  • Loading branch information
bigtallcampbell committed Jul 22, 2024
1 parent 0933270 commit c816f65
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/integrationTests/Tests/DeploymentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit c816f65

Please sign in to comment.