Mesa (main): ci/lava: Cancel the job if the script is interrupted
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Apr 28 07:34:16 UTC 2022
Module: Mesa
Branch: main
Commit: 5fc333d0b6acdcacc3a8f788216ea33654c5ae9f
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5fc333d0b6acdcacc3a8f788216ea33654c5ae9f
Author: Guilherme Gallo <guilherme.gallo at collabora.com>
Date: Fri Apr 8 11:52:50 2022 -0300
ci/lava: Cancel the job if the script is interrupted
During development, we may want to test lava_job_submitter.py locally,
sometimes one can find what one is been looking for before the LAV job
is done. Let's respond to SIGINT signal and cancel the LAVA job, as we
can't follow what is happening anymore via script.
Signed-off-by: Guilherme Gallo <guilherme.gallo at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>
---
.gitlab-ci/lava/lava_job_submitter.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/.gitlab-ci/lava/lava_job_submitter.py b/.gitlab-ci/lava/lava_job_submitter.py
index f840145c172..486fd1608da 100755
--- a/.gitlab-ci/lava/lava_job_submitter.py
+++ b/.gitlab-ci/lava/lava_job_submitter.py
@@ -395,6 +395,10 @@ def retriable_follow_job(proxy, job_definition):
except MesaCIException as mesa_exception:
print_log(mesa_exception)
job.cancel()
+ except KeyboardInterrupt as e:
+ print_log("LAVA job submitter was interrupted. Cancelling the job.")
+ job.cancel()
+ raise e
finally:
print_log(f"Finished executing LAVA job in the attempt #{attempt_no}")
More information about the mesa-commit
mailing list