From 4ef9efa722632797fc58aa3376d6bce96e1942c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 26 Jan 2021 14:57:34 +0100 Subject: [PATCH] CI: retry to work around flaky tests We have flaky tests[1] that keep causing false alarms in the CI, so people have to waste time looking at the same issue and click "retry" manually. Let's do that retry automatically. We'll waste less time just having it retry so you'll potentially wait a bit more for a real failure, v.s. the false alarms. This is an interim solution for[1]. We should also fix those tests, a smarter way to do this would be to quickly annotate known failed tests, or to have "make test" et al smartly retry just the failing tests, but just doing this is simpler and better than the status quo. 1. https://gitlab.com/gitlab-org/gitaly/-/issues?label_name[]=failure%3A%3Aflaky-test --- .gitlab-ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1640488fac7..b5b7c269169 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,8 +51,12 @@ danger-review: - _build/Makefile.sha256 - ruby/vendor/bundle +.test_template: &retry_definition + retry: 2 + .test_template: &test_definition <<: *cache_definition + <<: *retry_definition stage: test # Override the cache definition for pull cache: @@ -257,16 +261,16 @@ praefect_sql_test: - make test-postgres lint: + <<: *retry_definition stage: test - retry: 2 script: - go version - make lint lint-strict: + <<: *retry_definition allow_failure: true stage: test - retry: 2 script: - go version - make lint-strict -- GitLab