ci/lava: Only parse result within testcase section

This commit fixes an issue related to leftover between jobs in the same
device under test in LAVA.

There is a possibility of having the resulting output being dumped just
after the boot, such as this job:
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/25674303#L155

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17752>
This commit is contained in:
Guilherme Gallo
2022-07-25 17:56:51 -03:00
committed by Marge Bot
parent 25dcb8d201
commit 2cb71ac530
3 changed files with 83 additions and 49 deletions

View File

@@ -390,7 +390,14 @@ def fetch_logs(job, max_idle_time, log_follower) -> None:
job.heartbeat()
parsed_lines = log_follower.flush()
parsed_lines = job.parse_job_result_from_log(parsed_lines)
# Only parse job results when the script reaches the end of the logs.
# Depending on how much payload the RPC scheduler.jobs.logs get, it may
# reach the LAVA_POST_PROCESSING phase.
if log_follower.current_section.type in (
LogSectionType.TEST_CASE,
LogSectionType.LAVA_POST_PROCESSING,
):
parsed_lines = job.parse_job_result_from_log(parsed_lines)
for line in parsed_lines:
print_log(line)