From 0a0060f544ea6a0edd92d506196d2d054babd19d 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 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 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/provision/become/test.sh b/tests/provision/become/test.sh index d6b266bbfc..adc0cca809 100755 --- a/tests/provision/become/test.sh +++ b/tests/provision/become/test.sh @@ -7,7 +7,15 @@ rlJournalStart if [[ "$PROVISION_METHODS" =~ container ]]; then rlPhaseStartSetup rlRun "pushd data" - rlRun "podman build -t become-container-test:latest ." + 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"