You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2019/07/26 23:55:04 UTC

[couchdb] 01/01: Retry EUnit tests on failure

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch retry-on-eunit-app-failure
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 78f6d59e166182efc80125290354b4adb737f9eb
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Fri Jul 26 19:52:19 2019 -0400

    Retry EUnit tests on failure
    
    Whole app is retried 2 extra times if it fails.
    
    Added to *nix Makefile only for now. May not be needed for Windows as this is
    for CI flakiness mostly.
---
 Makefile | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 0acf828..424974c 100644
--- a/Makefile
+++ b/Makefile
@@ -169,9 +169,19 @@ eunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config
 eunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell pwd)/bin/couchjs $(shell pwd)/share/server/main.js
 eunit: couch
 	@$(REBAR) setup_eunit 2> /dev/null
-	@for dir in $(subdirs); do \
-	  $(REBAR) -r eunit $(EUNIT_OPTS) apps=$$dir || exit 1; \
-	done
+	@@for dir in $(subdirs); do \
+            tries=0; \
+            while true; do \
+                $(REBAR) -r eunit $(EUNIT_OPTS) apps=$$dir ; \
+                if [ $$? -eq 0 ]; then \
+                    break; \
+                else \
+                    let "tries=tries+1"; \
+                    [ $$tries -gt 2 ] && exit 1; \
+                fi \
+            done \
+        done
+
 
 setup-eunit: export BUILDDIR = $(shell pwd)
 setup-eunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config