From 219df82f79d8a707f53a9ad1c9bb91b71222e9de Mon Sep 17 00:00:00 2001 From: ydshieh Date: Wed, 22 May 2024 17:11:58 +0200 Subject: [PATCH] fix --- utils/notification_service.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/utils/notification_service.py b/utils/notification_service.py index 6f27682dbd7984..60a2205d912ff3 100644 --- a/utils/notification_service.py +++ b/utils/notification_service.py @@ -636,7 +636,7 @@ def get_reply_blocks(self, job_name, job_result, failures, device, text): {"type": "section", "text": {"type": "mrkdwn", "text": failure_text}}, ] - def get_new_model_failure_blocks(self, with_header=True): + def get_new_model_failure_blocks(self, with_header=True, truncate=True): if self.prev_ci_artifacts is None: return {} @@ -675,6 +675,8 @@ def get_new_model_failure_blocks(self, with_header=True): all_failure_lines[new_text].append(f"<{url}|{device}>" if url is not None else device) MAX_ERROR_TEXT = 3000 - len("[Truncated]") - len("```New model failures```\n\n") + if not truncate: + MAX_ERROR_TEXT = float("inf") failure_text = "" for line, devices in all_failure_lines.items(): new_text = failure_text + f"{'|'.join(devices)} gpu\n{line}" @@ -746,6 +748,12 @@ def post_reply(self): time.sleep(1) + blocks = self.get_new_model_failure_blocks(truncate=False) + failure_text = blocks[-1]["text"]["text"] + file_path = os.path.join(os.getcwd(), f"ci_results_{job_name}/new_model_failures.txt") + with open(file_path, "w", encoding="UTF-8") as fp: + fp.write(failure_text) + blocks = self.get_new_model_failure_blocks() if blocks: print("Sending the following reply")