Skip to content

Commit

Permalink
Pod logs in tests when startup fails (#5901)
Browse files Browse the repository at this point in the history
  • Loading branch information
oseoin authored Jul 1, 2024
1 parent 3630ec0 commit 50540ae
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/suite/utils/resources_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,14 @@ def wait_until_all_pods_are_ready(v1: CoreV1Api, namespace) -> None:
wait_before_test()
counter = counter + 1
if counter >= 300:
print("\n===================== IC Logs Start =====================")
try:
pod_name = get_pod_name_that_contains(kube_apis.v1, "nginx-ingress", "nginx-ingress")
logs = kube_apis.v1.read_namespaced_pod_log(pod_name, "nginx-ingress")
print(logs)
except:
print("Failed to load logs for nginx-ingress pod")
print("\n===================== IC Logs End =====================")
raise PodNotReadyException()
print("All pods are Ready")

Expand Down

0 comments on commit 50540ae

Please sign in to comment.