Skip to content

Commit

Permalink
infra: catch any http errors when checking build status
Browse files Browse the repository at this point in the history
Signed-off-by: David Korczynski <[email protected]>
  • Loading branch information
DavidKorczynski committed Feb 20, 2025
1 parent e3e48c9 commit 91d0491
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions infra/build/functions/trial_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import urllib.request

from googleapiclient.discovery import build as cloud_build
from googleapiclient.errors import HttpError
import oauth2client.client
import yaml

Expand Down Expand Up @@ -252,8 +253,13 @@ def check_finished(build_id, project, cloudbuild_api, cloud_project,
build_results):
"""Checks that the |build_type| build is complete. Updates |project_status| if
complete."""
build_status = get_build_status_from_gcb(cloudbuild_api, cloud_project,
build_id)

try:
build_status = get_build_status_from_gcb(cloudbuild_api, cloud_project,
build_id)
except HttpError:
logging.debug('build: HttpError when getting build status from gcb')
return False
if build_status not in FINISHED_BUILD_STATUSES:
logging.debug('build: %d not finished.', build_id)
return False
Expand Down

0 comments on commit 91d0491

Please sign in to comment.