mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-27 12:14:10 +08:00
3e33171471
This commit refactors the exception hierarchy to differentiate between retriable and fatal errors in the CI pipeline, specifically within the LAVA job submission process. A new base class, `MesaCIRetriableException`, is introduced for exceptions that should trigger a retry of the CI job, while `MesaCIFatalException` is added for non-recoverable errors that halt the process immediately. Additionally, the logic for deciding whether a job should be retried or not is updated to check for instances of `MesaCIRetriableException`, improving the robustness and reliability of the CI job execution strategy. Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28778>
42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
from datetime import timedelta
|
|
|
|
|
|
class MesaCIException(Exception):
|
|
pass
|
|
|
|
|
|
class MesaCIRetriableException(MesaCIException):
|
|
pass
|
|
|
|
|
|
class MesaCITimeoutError(MesaCIRetriableException):
|
|
def __init__(self, *args, timeout_duration: timedelta) -> None:
|
|
super().__init__(*args)
|
|
self.timeout_duration = timeout_duration
|
|
|
|
|
|
class MesaCIRetryError(MesaCIRetriableException):
|
|
def __init__(self, *args, retry_count: int, last_job: None) -> None:
|
|
super().__init__(*args)
|
|
self.retry_count = retry_count
|
|
self.last_job = last_job
|
|
|
|
|
|
class MesaCIFatalException(MesaCIException):
|
|
"""Exception raised when the Mesa CI script encounters a fatal error that
|
|
prevents the script from continuing."""
|
|
|
|
def __init__(self, *args) -> None:
|
|
super().__init__(*args)
|
|
|
|
|
|
class MesaCIParseException(MesaCIRetriableException):
|
|
pass
|
|
|
|
|
|
class MesaCIKnownIssueException(MesaCIRetriableException):
|
|
"""Exception raised when the Mesa CI script finds something in the logs that
|
|
is known to cause the LAVA job to eventually fail"""
|
|
|
|
pass
|