From ca19f20aff50465fe75db5dcbf54b19c02c5db11 Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Tue, 2 May 2023 12:34:40 +0200 Subject: [PATCH] Do not fail the run on error updating status comment --- tests/ci/commit_status_helper.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/ci/commit_status_helper.py b/tests/ci/commit_status_helper.py index 666eb27919e..9f24c988487 100644 --- a/tests/ci/commit_status_helper.py +++ b/tests/ci/commit_status_helper.py @@ -101,7 +101,21 @@ def post_commit_status( raise ex time.sleep(i) if pr_info: - set_status_comment(commit, pr_info) + status_updated = False + for i in range(RETRY): + try: + set_status_comment(commit, pr_info) + status_updated = True + break + except Exception as ex: + logging.warning( + "Failed to update the status commit, will retry %s times: %s", + RETRY - i - 1, + ex, + ) + + if not status_updated: + logging.error("Failed to update the status comment, continue anyway") def set_status_comment(commit: Commit, pr_info: PRInfo) -> None: