From f0c5592ba1420819113e21802da4dcefd49d75e3 Mon Sep 17 00:00:00 2001 From: Michael Zhao Date: Wed, 6 Dec 2023 07:55:40 +0000 Subject: [PATCH] scripts: Workaround random wget failures on AArch64 Random failures of downloading `cloud-hypervisor-static-aarch64` with `wget` were seen. The commit applies a workaround to retry the download for a few times. Signed-off-by: Michael Zhao --- scripts/run_integration_tests_aarch64.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/run_integration_tests_aarch64.sh b/scripts/run_integration_tests_aarch64.sh index 8a972a415..3dd38b780 100755 --- a/scripts/run_integration_tests_aarch64.sh +++ b/scripts/run_integration_tests_aarch64.sh @@ -163,8 +163,21 @@ update_workloads() { CH_RELEASE_URL="https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/$LAST_RELEASE_VERSION/cloud-hypervisor-static-aarch64" CH_RELEASE_NAME="cloud-hypervisor-static-aarch64" pushd $WORKLOADS_DIR - time wget $CH_RELEASE_URL -O "$CH_RELEASE_NAME" || exit 1 - chmod +x $CH_RELEASE_NAME + # Repeat a few times to workaround a random wget failure + WGET_RETRY_MAX=10 + wget_retry=0 + + until [ "$wget_retry" -ge "$WGET_RETRY_MAX" ] + do + time wget $CH_RELEASE_URL -O "$CH_RELEASE_NAME" && break + wget_retry=$((wget_retry+1)) + done + + if [ $wget_retry -ge "$WGET_RETRY_MAX" ]; then + exit 1 + else + chmod +x $CH_RELEASE_NAME + fi popd # Build custom kernel for guest VMs