From adeac919103edfd78b40655bab3b58839747ad10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Tue, 12 Apr 2022 14:44:42 -0300 Subject: [PATCH] Retry unit tests upon failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Juraci Paixão Kröhling --- Makefile.Common | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile.Common b/Makefile.Common index 65888ea116f9..d07a27d99aa0 100644 --- a/Makefile.Common +++ b/Makefile.Common @@ -43,7 +43,10 @@ common: checklicense checkdoc impi lint misspell .PHONY: test test: - $(GOTEST) $(GOTEST_OPT) ./... + @# attempts to run the tests at most 5 times + for i in {1..5}; do \ + $(GOTEST) $(GOTEST_OPT) ./... && break || echo "Tests failed (attempt #$$i)"; \ + done .PHONY: do-unit-tests-with-cover do-unit-tests-with-cover: