summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Vatamaniuc <vatamane@apache.org>2019-07-26 19:52:19 -0400
committerNick Vatamaniuc <vatamane@apache.org>2019-07-29 10:48:17 -0400
commitf152fd793a7f48c4f4f98297cc69b536d86bb4c6 (patch)
tree0f64cf47f132a3854e8b85b92d5b0659e34b990f
parentf37e1e73205e98d6a74a714a23c4a59f7cf2bb0b (diff)
downloadcouchdb-retry-on-eunit-app-failure.tar.gz
Retry EUnit tests on failureretry-on-eunit-app-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.
-rw-r--r--Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 58c814885..ed22509e2 100644
--- a/Makefile
+++ b/Makefile
@@ -170,8 +170,18 @@ eunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell pwd)/bin/couchjs $(shell
eunit: couch
@$(REBAR) setup_eunit 2> /dev/null
@for dir in $(subdirs); do \
- $(REBAR) -r eunit $(EUNIT_OPTS) apps=$$dir || exit 1; \
- done
+ 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
+
.PHONY: exunit
# target: exunit - Run ExUnit tests