From f5f9ef1f66ef3e13ba32f2e1b4dbc51543665626 Mon Sep 17 00:00:00 2001 From: GWphua Date: Fri, 20 Dec 2024 18:41:13 +0800 Subject: [PATCH] Fix bug where exit on 3rd success --- integration-tests/docker/Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/integration-tests/docker/Dockerfile b/integration-tests/docker/Dockerfile index 388edff5bec..c31d4a71861 100644 --- a/integration-tests/docker/Dockerfile +++ b/integration-tests/docker/Dockerfile @@ -27,18 +27,19 @@ ARG ZK_VERSION ARG APACHE_ARCHIVE_MIRROR_HOST=https://archive.apache.org ARG SETUP_RETRIES=3 # Retry mechanism for running the setup script up to limit of 3 times. -RUN for i in $(seq 1 $SETUP_RETRIES); do \ - echo "Attempt $i to run the setup script..."; \ +RUN i=0; \ + while [ $i -lt $SETUP_RETRIES ]; do \ APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && break || { \ + i=$(($i + 1)); \ echo "Set up script attempt $i/$SETUP_RETRIES failed."; \ sleep 2; \ }; \ done; \ - LAST_EXIT_CODE=$?; \ rm -f /root/base-setup.sh; \ - if [ "$i" -eq "$SETUP_RETRIES" ] && [ "$LAST_EXIT_CODE" -ne 0 ]; then \ - exit LAST_EXIT_CODE; \ - fi; \ + if [ "$i" -eq "$SETUP_RETRIES" ]; then \ + exit 1; \ + fi + FROM druidbase ARG MYSQL_VERSION