From 7200c3f45909c30d652061e5df6a07b47b838622 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Fri, 24 Jan 2020 15:51:41 -0800 Subject: [PATCH] retry logic for another cipd upload (flutter/engine#15974) --- .../tools/fuchsia/build_fuchsia_artifacts.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/tools/fuchsia/build_fuchsia_artifacts.py b/engine/src/flutter/tools/fuchsia/build_fuchsia_artifacts.py index a86dd9749d..30aeba725b 100755 --- a/engine/src/flutter/tools/fuchsia/build_fuchsia_artifacts.py +++ b/engine/src/flutter/tools/fuchsia/build_fuchsia_artifacts.py @@ -173,8 +173,18 @@ def ProcessCIPDPackage(upload, engine_version): os.path.join(_bucket_directory, 'fuchsia.cipd') ] - subprocess.check_call(command, cwd=_bucket_directory) - + # Retry up to three times. We've seen CIPD fail on verification in some + # instances. Normally verification takes slightly more than 1 minute when + # it succeeds. + num_tries = 3 + for tries in range(num_tries): + try: + subprocess.check_call(command, cwd=_bucket_directory) + break + except subprocess.CalledProcessError: + print('Failed %s times' % tries + 1) + if tries == num_tries - 1: + raise def GetRunnerTarget(runner_type, product, aot): base = '%s/%s:' % (_fuchsia_base, runner_type)