From 964b9791315a58fc3b46598277ab5f8b1f4a2e32 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 2 Sep 2024 13:30:54 +0100 Subject: [PATCH] ci/lava: Add section for device wait This way it's easier to see how long it took. Signed-off-by: Daniel Stone Part-of: --- .gitlab-ci/lava/lava_job_submitter.py | 9 ++++++++- .gitlab-ci/lava/utils/log_section.py | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci/lava/lava_job_submitter.py b/.gitlab-ci/lava/lava_job_submitter.py index d21aade7312..e36707efaf9 100755 --- a/.gitlab-ci/lava/lava_job_submitter.py +++ b/.gitlab-ci/lava/lava_job_submitter.py @@ -324,7 +324,14 @@ def execute_job_with_retries( try: job_log["submitter_start_time"] = datetime.now().isoformat() submit_job(job) - wait_for_job_get_started(job, attempt_no) + queue_section = GitlabSection( + id="dut_queue", + header="Waiting for hardware device to become available", + type=LogSectionType.LAVA_QUEUE, + start_collapsed=False, + ) + with queue_section as section: + wait_for_job_get_started(job, attempt_no) log_follower: LogFollower = bootstrap_log_follower() follow_job_execution(job, log_follower) return job diff --git a/.gitlab-ci/lava/utils/log_section.py b/.gitlab-ci/lava/utils/log_section.py index 25620a6155b..0c0a20b5783 100644 --- a/.gitlab-ci/lava/utils/log_section.py +++ b/.gitlab-ci/lava/utils/log_section.py @@ -10,12 +10,17 @@ from lava.utils.gitlab_section import GitlabSection class LogSectionType(Enum): UNKNOWN = auto() + LAVA_QUEUE = auto() LAVA_BOOT = auto() TEST_DUT_SUITE = auto() TEST_SUITE = auto() TEST_CASE = auto() LAVA_POST_PROCESSING = auto() +# How long should we wait for a device to become available? +# For post-merge jobs, this should be ~infinite, but we can fail more +# aggressively for pre-merge. +LAVA_QUEUE_TIMEOUT = int(getenv("LAVA_QUEUE_TIMEOUT", 60)) # Empirically, successful device boot in LAVA time takes less than 3 # minutes. @@ -43,6 +48,7 @@ LAVA_POST_PROCESSING_TIMEOUT = int(getenv("LAVA_POST_PROCESSING_TIMEOUT", 5)) FALLBACK_GITLAB_SECTION_TIMEOUT = timedelta(minutes=10) DEFAULT_GITLAB_SECTION_TIMEOUTS = { + LogSectionType.LAVA_QUEUE: timedelta(minutes=LAVA_QUEUE_TIMEOUT), LogSectionType.LAVA_BOOT: timedelta(minutes=LAVA_BOOT_TIMEOUT), LogSectionType.TEST_DUT_SUITE: timedelta(minutes=LAVA_TEST_DUT_SUITE_TIMEOUT), LogSectionType.TEST_SUITE: timedelta(minutes=LAVA_TEST_SUITE_TIMEOUT),