From 1afe174ff4ee32dff3ace2bd7e7f9fffaf302c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0pl=C3=ADchal?= Date: Wed, 8 Nov 2023 13:33:05 +0100 Subject: [PATCH] Try several times to build the `become` container Seems this is the only point where the podman tests are still failing with the random network errors tracked in #2063. Let's give several attempts to build the container to reduce the failures. --- tests/provision/become/test.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/provision/become/test.sh b/tests/provision/become/test.sh index d6b266bbfc..d89e36be97 100755 --- a/tests/provision/become/test.sh +++ b/tests/provision/become/test.sh @@ -7,7 +7,17 @@ rlJournalStart if [[ "$PROVISION_METHODS" =~ container ]]; then rlPhaseStartSetup rlRun "pushd data" - rlRun "podman build -t become-container-test:latest ." + # Try several times to build the container + # https://github.com/teemtee/tmt/issues/2063 + for attempt in {1..5}; do + if rlRun "podman build -t become-container-test:latest ."; then + break + else + echo "Attempt $attempt unsuccessful." + [[ $attempt == 5 ]] && rlDie "Unable to prepare the image" + sleep 5 + fi + done rlPhaseEnd rlPhaseStartTest "Container, test with become=true"