ci/lava: Fix how exception entry in structured log

Improves the error logging in the LAVA job submitter by capturing and
logging the exception message rather than just the exception type when a
job fails to run.

Additionally, introduces a clearer script interruption
message to aid in debugging and immediate understanding of job
submission failures.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28778>
This commit is contained in:
Guilherme Gallo
2024-04-11 18:52:30 -03:00
committed by Marge Bot
parent e96e25f323
commit 4b81ee6418

View File

@@ -498,8 +498,9 @@ class LAVAJobSubmitter(PathResolver):
if not last_attempt_job:
# No job was run, something bad happened
STRUCTURAL_LOG["job_combined_status"] = "script_crash"
current_exception = str(sys.exc_info()[0])
current_exception = str(sys.exc_info()[1])
STRUCTURAL_LOG["job_combined_fail_reason"] = current_exception
print(f"Interrupting the script. Reason: {current_exception}")
raise SystemExit(1)
STRUCTURAL_LOG["job_combined_status"] = last_attempt_job.status