From d6e0dc7169f56842c492a45d97a5b649d8fa47ec Mon Sep 17 00:00:00 2001 From: ZyX Date: Thu, 8 Jan 2015 02:30:03 +0300 Subject: [PATCH] Use more then one attempt to run shell tests They are rather unstable, especially IPython + PyPy, but others also are. --- tests/test_shells/test.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test_shells/test.sh b/tests/test_shells/test.sh index 4244c976..a9080e09 100755 --- a/tests/test_shells/test.sh +++ b/tests/test_shells/test.sh @@ -90,7 +90,7 @@ run() { NL="$(printf '\nE')" NL="${NL%E}" -run_test() { +do_run_test() { TEST_TYPE="$1" shift TEST_CLIENT="$1" @@ -180,6 +180,15 @@ run_test() { return 0 } +run_test() { + local attempts=3 + while test $attempts -gt 0 ; do + do_run_test "$@" && return 0 + attempts=$(( attempts - 1 )) + done + return 1 +} + test -d tests/shell && rm -r tests/shell mkdir tests/shell git init tests/shell/3rd