From 0557a774ac2ca941ba72c5e4952487e0b5f0d65b Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 13 Aug 2020 15:03:36 -0700 Subject: [PATCH] Retry `bodhi updates download` a few times if it fails It's failing about one in six tries currently, with Bodhi 5.5 on the server end: https://github.com/fedora-infra/bodhi/issues/4105 this should work around that. Signed-off-by: Adam Williamson --- lib/utils.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/utils.pm b/lib/utils.pm index d634bfbc..84e96345 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -446,7 +446,18 @@ sub setup_workaround_repo { # then we'll download each update for our release: my $advisories = $workarounds{$version}; foreach my $advisory (@$advisories) { - assert_script_run "bodhi updates download --updateid=$advisory", 180; + my $count = 3; + my $success = 0; + while ($count) { + if (script_run "bodhi updates download --updateid=$advisory", 180) { + $count -= 1; + } + else { + $count = 0; + $success = 1; + } + } + die "Workaround update download failed!" unless $success; } # and create repo metadata assert_script_run "createrepo .";