aboutsummaryrefslogtreecommitdiff
path: root/tests/check-failure.sh
diff options
context:
space:
mode:
authorMichal Nasiadka <mnasiadka@gmail.com>2025-03-12 12:28:58 +0100
committerMichal Nasiadka <mnasiadka@gmail.com>2025-03-20 16:22:26 +0000
commitf9790cf0b9abff074b0f191516967b9f4a780250 (patch)
treef545ece48066d12aee04c8568d036cc1cc8775da /tests/check-failure.sh
parent88e94f29bbd720b48fb671cb57e57e58f13c0829 (diff)
downloadkolla-ansible-f9790cf0b9abff074b0f191516967b9f4a780250.tar.gz
kolla-ansible-f9790cf0b9abff074b0f191516967b9f4a780250.zip
CI: Wait until containers exit health starting state
Change-Id: I4a0e056eef797afcb446833347fbe139fd7d6677
Diffstat (limited to 'tests/check-failure.sh')
-rwxr-xr-xtests/check-failure.sh26
1 files changed, 26 insertions, 0 deletions
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
}