From 3b22d334d66adec97361fe73193334397a72af20 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Tue, 7 Sep 2021 09:56:26 +0100 Subject: [PATCH] CI: monasca: ignore exited monasca_thresh container Ignore the monasca_thresh container if it is listed as exited. The container was recently changed to operate as a 'one shot' container, submitting a job to storm then exiting. This does not fit with the usual pattern of Kolla Ansible container usage, but is harmless. Depends-On: https://review.opendev.org/c/openstack/kolla/+/811977 Change-Id: Id40d2260a67ef604255fb1818d41cdcbc73164d7 --- tests/check-failure.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/check-failure.sh b/tests/check-failure.sh index fe03c98e3a..46b5241193 100755 --- a/tests/check-failure.sh +++ b/tests/check-failure.sh @@ -23,11 +23,17 @@ check_failure() { unhealthy_containers=$(sudo docker ps -a --format "{{.Names}}" \ --filter health=unhealthy) - if [[ -n "$failed_containers" ]]; then + if [[ -n "$unhealthy_containers" ]]; then exit 1; fi - if [[ -n "$unhealthy_containers" ]]; then + # NOTE(mgoddard): monasca-thresh is a one-shot container that exits but + # remains in place, leaving it with a status of exited. This is harmless. + if [[ "$failed_containers" = "monasca_thresh" ]]; then + exit 0 + fi + + if [[ -n "$failed_containers" ]]; then exit 1; fi }