From 9b849e88c0b8ca4f8891228f6912f022428a58c0 Mon Sep 17 00:00:00 2001 From: Venktesh Date: Mon, 26 Feb 2024 14:14:13 +0000 Subject: [PATCH] check pod status before getting logs --- tests/suite/test_virtual_server_externaldns.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/suite/test_virtual_server_externaldns.py b/tests/suite/test_virtual_server_externaldns.py index 7efa9a7b2b..fe93f04dc5 100644 --- a/tests/suite/test_virtual_server_externaldns.py +++ b/tests/suite/test_virtual_server_externaldns.py @@ -2,7 +2,12 @@ from settings import TEST_DATA from suite.utils.custom_assertions import assert_event, assert_event_not_present from suite.utils.custom_resources_utils import is_dnsendpoint_present, read_custom_resource -from suite.utils.resources_utils import get_events, patch_namespace_with_label, wait_before_test +from suite.utils.resources_utils import ( + get_events, + patch_namespace_with_label, + wait_before_test, + wait_until_all_pods_are_ready, +) from suite.utils.vs_vsr_resources_utils import patch_virtual_server_from_yaml from suite.utils.yaml_utils import get_name_from_yaml, get_namespace_from_yaml @@ -39,6 +44,7 @@ def test_responses_after_setup( assert dep is True print("\nStep 2: Verify external-dns picked up the record") pod_ns = get_namespace_from_yaml(f"{TEST_DATA}/virtual-server-external-dns/external-dns.yaml") + wait_until_all_pods_are_ready(kube_apis.v1, pod_ns) pod_name = kube_apis.v1.list_namespaced_pod(pod_ns).items[0].metadata.name log_contents = kube_apis.v1.read_namespaced_pod_log(pod_name, pod_ns) wanted_string = "CREATE: virtual-server.example.com 0 IN A" @@ -140,6 +146,7 @@ def test_responses_after_setup( assert dep is True print("\nStep 2: Verify external-dns picked up the record") pod_ns = get_namespace_from_yaml(f"{TEST_DATA}/virtual-server-external-dns/external-dns.yaml") + wait_until_all_pods_are_ready(kube_apis.v1, pod_ns) pod_name = kube_apis.v1.list_namespaced_pod(pod_ns).items[0].metadata.name log_contents = kube_apis.v1.read_namespaced_pod_log(pod_name, pod_ns) wanted_string = "CREATE: virtual-server.example.com 0 IN A"