From f61ec0af8573582780f4c82677d4acf43a6638b5 Mon Sep 17 00:00:00 2001 From: Virushade <70288012+GWphua@users.noreply.github.com> Date: Sat, 7 Dec 2024 01:57:38 +0800 Subject: [PATCH] Reduce occurrences of failed IT builds (#17543) Reduce occurrences of failed IT builds: break up the setup command and add a few retries to improve resiliency. --- integration-tests/docker/Dockerfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/integration-tests/docker/Dockerfile b/integration-tests/docker/Dockerfile index df8c6f2598b..89fd45c9778 100644 --- a/integration-tests/docker/Dockerfile +++ b/integration-tests/docker/Dockerfile @@ -25,7 +25,17 @@ ARG KAFKA_VERSION # This is passed in by maven at build time to align with the client version we depend on in the pom file ARG ZK_VERSION ARG APACHE_ARCHIVE_MIRROR_HOST=https://archive.apache.org -RUN APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && rm -f /root/base-setup.sh +ARG SETUP_RETRIES=3 +# Retry mechanism for running the setup script up to limit of 3 times. +RUN set -e; \ + for i in $(seq 1 $SETUP_RETRIES); do \ + echo "Attempt $i to run the setup script..."; \ + APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && break || { \ + echo "Set up script attempt $i/$SETUP_RETRIES failed."; \ + sleep 2; \ + }; \ + done; \ + rm -f /root/base-setup.sh FROM druidbase ARG MYSQL_VERSION