Skip to content

Commit af4e2b2

Browse files
authored
Add a retry decorator to the GitHub log downloader. (#1387)
* Add a retry decorator to the GitHub log downloader. * Fix retry syntax.
1 parent 9033da3 commit af4e2b2

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

external/pip_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
absl-py
22
protobuf
3+
retry

scripts/gha/integration_testing/ftl_gha_validator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import subprocess
2020
import shutil
2121
import re
22+
from retry import retry
2223

2324
GSUTIL = shutil.which("gsutil")
2425

@@ -73,7 +74,7 @@ def _get_testapp_log_text_from_gcs(gcs_path):
7374
logging.error("Unexpected error reading GCS log:\n%s", e)
7475
return None
7576

76-
77+
@retry(subprocess.CalledProcessError, tries=3, delay=10)
7778
def _gcs_list_dir(gcs_path):
7879
"""Recursively returns a list of contents for a directory on GCS."""
7980
args = [GSUTIL, "ls", "-r", gcs_path]
@@ -82,6 +83,7 @@ def _gcs_list_dir(gcs_path):
8283
return result.stdout.splitlines()
8384

8485

86+
@retry(subprocess.CalledProcessError, tries=3, delay=10)
8587
def _gcs_read_file(gcs_path):
8688
"""Extracts the contents of a file on GCS."""
8789
args = [GSUTIL, "cat", gcs_path]

scripts/gha/python_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ attrs
22
absl-py
33
pytz
44
requests
5+
retry

0 commit comments

Comments
 (0)