From c91c3bf8e154ea1ae3444c4705041f0a709a2af0 Mon Sep 17 00:00:00 2001 From: Oliver Kurz Date: Sun, 22 Oct 2023 14:24:47 +0200 Subject: [PATCH] Retry on sporadic git clone failure This should avoid issues like observed in https://openqa.opensuse.org/t3664694#step/build/4 --- tests/containers/build.pm | 2 +- tests/install/openqa_webui.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/containers/build.pm b/tests/containers/build.pm index f866dc33..74827473 100644 --- a/tests/containers/build.pm +++ b/tests/containers/build.pm @@ -3,7 +3,7 @@ use base 'openQAcoretest'; use testapi; sub run { - assert_script_run('git clone https://github.com/os-autoinst/openQA.git', timeout => 300); + assert_script_run('retry -s 30 -e -- git clone https://github.com/os-autoinst/openQA.git', timeout => 300); assert_script_run("retry -s 30 -r 7 -e -- docker build openQA/container/$_ -t openqa_$_", timeout => 3800) for qw(webui worker); assert_script_run('retry -s 30 -r 7 -e -- docker build openQA/container/openqa_data -t openqa_data', timeout => 3800); } diff --git a/tests/install/openqa_webui.pm b/tests/install/openqa_webui.pm index b98847d9..256f8064 100644 --- a/tests/install/openqa_webui.pm +++ b/tests/install/openqa_webui.pm @@ -44,7 +44,7 @@ sub install_from_git { systemctl start postgresql || systemctl status --no-pager postgresql su - postgres -c 'createuser root' su - postgres -c 'createdb -O root openqa' - git clone https://github.com/os-autoinst/openQA.git + retry -e -s 30 -- git clone https://github.com/os-autoinst/openQA.git cd openQA pkgs=$(for p in $(cpanfile-dump); do echo -n "perl($p) "; done); retry -e -s 30 -- zypper -n in -C $pkgs cpanm -nq --installdeps .