From de66b4d8970d0867f0eaf1009cfd66e3a3f9c3ec Mon Sep 17 00:00:00 2001 From: Andrew Holway Date: Tue, 6 May 2025 19:24:24 +0100 Subject: [PATCH] try 5 times to get status before failing --- chipflow_lib/steps/silicon.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/chipflow_lib/steps/silicon.py b/chipflow_lib/steps/silicon.py index 73a302c9..beb81f53 100644 --- a/chipflow_lib/steps/silicon.py +++ b/chipflow_lib/steps/silicon.py @@ -199,6 +199,7 @@ def submit(self, rtlil_path, *, dry_run=False, wait=False): # Poll the status API until the build is completed or failed stream_event_counter = 0 + fail_counter = 0 if wait: while True: logger.info("Polling build status...") @@ -207,8 +208,11 @@ def submit(self, rtlil_path, *, dry_run=False, wait=False): auth=(None, chipflow_api_key) ) if status_resp.status_code != 200: - logger.error(f"Failed to fetch build status: {status_resp.text}") - raise ChipFlowError("Error while checking build status.") + fail_counter += 1 + logger.error(f"Failed to fetch build status {fail_counter} times: {status_resp.text}") + if fail_counter > 5: + logger.error(f"Failed to fetch build status {fail_counter} times. Exiting.") + raise ChipFlowError("Error while checking build status.") status_data = status_resp.json() build_status = status_data.get("status")