Mesa (main): ci/lava: Iterate all job results, not just the first
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jun 10 06:26:34 UTC 2021
Module: Mesa
Branch: main
Commit: f8c4f32558f3b4f1ae63e236d0e9b9781ecae8c3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f8c4f32558f3b4f1ae63e236d0e9b9781ecae8c3
Author: Daniel Stone <daniels at collabora.com>
Date: Wed Jun 9 14:53:23 2021 +0100
ci/lava: Iterate all job results, not just the first
Each step in a LAVA job returns separate results; a successfully-retired
job can have about 12 entries. Make sure we iterate through all of them
when we're looking for infrastructure errors.
Signed-off-by: Daniel Stone <daniels at collabora.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11218>
---
.gitlab-ci/lava_job_submitter.py | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/.gitlab-ci/lava_job_submitter.py b/.gitlab-ci/lava_job_submitter.py
index 8695c2b8d5c..3294915762d 100755
--- a/.gitlab-ci/lava_job_submitter.py
+++ b/.gitlab-ci/lava_job_submitter.py
@@ -106,13 +106,16 @@ def _call_proxy(fn, *args):
def get_job_results(proxy, job_id, test_suite, test_case):
+ # Look for infrastructure errors and retry if we see them.
results_yaml = _call_proxy(proxy.results.get_testjob_results_yaml, job_id)
results = yaml.load(results_yaml, Loader=loader(False))
-
- metadata = results[0]['metadata']
- if metadata['result'] == 'fail' and 'error_type' in metadata and metadata['error_type'] == "Infrastructure":
- print_log("LAVA job {} failed with Infrastructure Error. Retry.".format(job_id))
- return False
+ for res in results:
+ metadata = res['metadata']
+ if not 'result' in metadata or metadata['result'] != 'fail':
+ continue
+ if 'error_type' in metadata and metadata['error_type'] == "Infrastructure":
+ print_log("LAVA job {} failed with Infrastructure Error. Retry.".format(job_id))
+ return False
results_yaml = _call_proxy(proxy.results.get_testcase_results_yaml, job_id, test_suite, test_case)
results = yaml.load(results_yaml, Loader=loader(False))
More information about the mesa-commit
mailing list