From c27b8e7fe78404ae7ad217e61510c1f0be3843c7 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 7 Jul 2020 12:26:43 -0700 Subject: [PATCH 1/2] tests/fedora32: retry dnf Fedora mirrors are not very stable recently, leading to CI failures that usually look like this: > sudo: make: command not found In fact it's caused by dnf failure to read metadata from mirrors: > Errors during downloading metadata for repository 'updates': > - Downloading successful, but checksum doesn't match. Calculated: <....> > Error: Failed to download metadata for repo 'updates': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried The error went undetected due to lack of exit code check. This commit: - adds `set -e -u -o pipefail` so the script will fail early; - adds a retry loop with a sleep around dnf invocation. Signed-off-by: Kir Kolyshkin --- Vagrantfile.fedora32 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Vagrantfile.fedora32 b/Vagrantfile.fedora32 index 6b3dc652e..b72954abd 100644 --- a/Vagrantfile.fedora32 +++ b/Vagrantfile.fedora32 @@ -13,13 +13,18 @@ Vagrant.configure("2") do |config| v.cpus = 2 end config.vm.provision "shell", inline: <<-SHELL - cat << EOF | dnf -y shell + set -e -u -o pipefail + # Work around dnf mirror failures by retrying a few times + for i in $(seq 0 2); do + sleep $i + cat << EOF | dnf -y shell && break config exclude kernel,kernel-core config install_weak_deps false update install iptables gcc make golang-go libseccomp-devel bats jq git-core criu skopeo ts run EOF + done dnf clean all # Add a user for rootless tests From ffe9f0b0fbcf93cd412ab2093c1977bf44ebf636 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 7 Jul 2020 14:34:48 -0700 Subject: [PATCH 2/2] Vagrantfile.centos7: do not ignore script failures Add `set -e -u -o pipefail` so the script will fail early if there's an error. Signed-off-by: Kir Kolyshkin --- Vagrantfile.centos7 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Vagrantfile.centos7 b/Vagrantfile.centos7 index 7342e4ab1..68ae9f0e9 100644 --- a/Vagrantfile.centos7 +++ b/Vagrantfile.centos7 @@ -12,6 +12,8 @@ Vagrant.configure("2") do |config| v.cpus = 2 end config.vm.provision "shell", inline: <<-SHELL + set -e -u -o pipefail + # configuration GO_VERSION="1.13.11" BATS_VERSION="v1.2.0"