ci/lava: Raise the post test metadata gathering retry count
authorGuilherme Gallo <guilherme.gallo@collabora.com>
Thu, 18 May 2023 11:44:25 +0000 (08:44 -0300)
committerMarge Bot <emma+marge@anholt.net>
Fri, 19 May 2023 14:45:17 +0000 (14:45 +0000)
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 <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22870>

.gitlab-ci/lava/lava_job_submitter.py

index 5eb624e..92923fc 100755 (executable)
@@ -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