Skip to content

Commit

Permalink
Try several times to build the become container
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
psss committed Nov 13, 2023
1 parent 40d9027 commit 4985688
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/provision/become/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4985688

Please sign in to comment.