From 32f6baec9eb50a6d7546b8a2ddb53eff35e7ba50 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 22 Jul 2020 17:04:23 +0200 Subject: [PATCH] Retry on build failures --- tools/snap/build_remote.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/snap/build_remote.py b/tools/snap/build_remote.py index d3400b4b9..8a4838209 100755 --- a/tools/snap/build_remote.py +++ b/tools/snap/build_remote.py @@ -43,10 +43,12 @@ def _build_snap(target, archs, status): retry = 3 while retry: exit_code = _execute_build(target, archs, status, workspace) + print(f'Build {target} for {"".join(archs)} (attempt {4-retry}/3) ended with exit code {exit_code}.') sys.stdout.flush() - # Do not retry if the snapcraft remote-build command has not been interrupted. - if exit_code == 0: + + # Retry if the snapcraft remote-build command has been interrupted. + if exit_code == 0 and 'Failed to build' not in status[target].values(): break retry = retry - 1