From f9790cf0b9abff074b0f191516967b9f4a780250 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Wed, 12 Mar 2025 12:28:58 +0100 Subject: CI: Wait until containers exit health starting state Change-Id: I4a0e056eef797afcb446833347fbe139fd7d6677 --- tests/check-failure.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'tests/check-failure.sh') diff --git a/tests/check-failure.sh b/tests/check-failure.sh index d291fdbe0..78fa9877e 100755 --- a/tests/check-failure.sh +++ b/tests/check-failure.sh @@ -22,8 +22,21 @@ check_podman_failures() { check_podman_unhealthies() { + while [ -n "$(sudo podman ps -a --format "{{.Names}}" --filter health=starting)" ]; do + echo "Containers with health status 'starting', waiting..." + sleep 10 + done + unhealthy_containers=$(sudo podman ps -a --format "{{.Names}}" \ --filter health=unhealthy) + + for container in $unhealthy_containers; do + echo "Discovered unhealthy container: $container" + echo "$container - ps axwuf" + sudo podman exec $container ps axwuf + echo "$container - netstat -an" + sudo podman exec $container netstat -an + done } @@ -48,8 +61,21 @@ check_docker_failures() { check_docker_unhealthies() { + while [ -n "$(sudo docker ps -a --format "{{.Names}}" --filter health=starting)" ]; do + echo "Containers with health status 'starting', waiting..." + sleep 10 + done + unhealthy_containers=$(sudo docker ps -a --format "{{.Names}}" \ --filter health=unhealthy) + + for container in $unhealthy_containers; do + echo "Discovered unhealthy container: $container" + echo "$container - ps axwuf" + sudo docker exec $container ps axwuf + echo "$container - netstat -an" + sudo docker exec $container netstat -an + done } -- cgit v1.2.3