From 80290bcdddf150789d936636e039e4c81c9c0c53 Mon Sep 17 00:00:00 2001 From: Guilherme Gallo Date: Thu, 18 May 2023 08:44:25 -0300 Subject: [PATCH] ci/lava: Raise the post test metadata gathering retry count In some devices, it takes a few dozens of seconds to LAVA post process the job and give final metadata related to the job. It is worth to wait a little more (up to 30 sec) to make structured log data more accurate. Signed-off-by: Guilherme Gallo Part-of: --- .gitlab-ci/lava/lava_job_submitter.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci/lava/lava_job_submitter.py b/.gitlab-ci/lava/lava_job_submitter.py index 5eb624e..92923fc 100755 --- a/.gitlab-ci/lava/lava_job_submitter.py +++ b/.gitlab-ci/lava/lava_job_submitter.py @@ -70,7 +70,7 @@ WAIT_FOR_DEVICE_POLLING_TIME_SEC = int( # the final details. WAIT_FOR_LAVA_POST_PROCESSING_SEC = int(getenv("LAVA_WAIT_LAVA_POST_PROCESSING_SEC", 5)) WAIT_FOR_LAVA_POST_PROCESSING_RETRIES = int( - getenv("LAVA_WAIT_LAVA_POST_PROCESSING_RETRIES", 3) + getenv("LAVA_WAIT_LAVA_POST_PROCESSING_RETRIES", 6) ) # How many seconds to wait between log output LAVA RPC calls. @@ -81,6 +81,7 @@ NUMBER_OF_RETRIES_TIMEOUT_DETECTION = int( getenv("LAVA_NUMBER_OF_RETRIES_TIMEOUT_DETECTION", 2) ) + def raise_exception_from_metadata(metadata: dict, job_id: int) -> None: """ Investigate infrastructure errors from the job metadata. @@ -138,10 +139,11 @@ def show_final_job_data(job, colour=f"{CONSOLE_LOG['BOLD']}{CONSOLE_LOG['FG_GREE if not job.is_post_processed(): waited_for_sec: int = ( - WAIT_FOR_LAVA_POST_PROCESSING_RETRIES * WAIT_FOR_DEVICE_POLLING_TIME_SEC + WAIT_FOR_LAVA_POST_PROCESSING_RETRIES + * WAIT_FOR_LAVA_POST_PROCESSING_SEC ) print_log( - f"Waited for {waited_for_sec} seconds" + f"Waited for {waited_for_sec} seconds " "for LAVA to post-process the job, it haven't finished yet. " "Dumping it's info anyway" ) @@ -477,6 +479,7 @@ class LAVAJobSubmitter(PathResolver): if last_attempt_job.status != "pass": raise SystemExit(1) + class StructuredLoggerWrapper: def __init__(self, submitter: LAVAJobSubmitter) -> None: self.__submitter: LAVAJobSubmitter = submitter -- 2.7.4