Skip to content

Commit 50540ae

Browse files
authored
Pod logs in tests when startup fails (#5901)
1 parent 3630ec0 commit 50540ae

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/suite/utils/resources_utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,14 @@ def wait_until_all_pods_are_ready(v1: CoreV1Api, namespace) -> None:
296296
wait_before_test()
297297
counter = counter + 1
298298
if counter >= 300:
299+
print("\n===================== IC Logs Start =====================")
300+
try:
301+
pod_name = get_pod_name_that_contains(kube_apis.v1, "nginx-ingress", "nginx-ingress")
302+
logs = kube_apis.v1.read_namespaced_pod_log(pod_name, "nginx-ingress")
303+
print(logs)
304+
except:
305+
print("Failed to load logs for nginx-ingress pod")
306+
print("\n===================== IC Logs End =====================")
299307
raise PodNotReadyException()
300308
print("All pods are Ready")
301309

0 commit comments

Comments
 (0)