aboutsummaryrefslogtreecommitdiff
path: root/ci/common
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-04-04 14:16:14 +0200
committerGitHub <noreply@github.com>2017-04-04 14:16:14 +0200
commit9d560d5c6b02d34690ca47ee6f32e31ee4a6d90e (patch)
tree9683b0c9145200b9e4ff91a1e227adfcf438a453 /ci/common
parentbc6d868d00a739050b683f33994f7493cf81bd61 (diff)
parent017f64b9707955e66319e07e6e8f173b29583235 (diff)
downloadrneovim-9d560d5c6b02d34690ca47ee6f32e31ee4a6d90e.tar.gz
rneovim-9d560d5c6b02d34690ca47ee6f32e31ee4a6d90e.tar.bz2
rneovim-9d560d5c6b02d34690ca47ee6f32e31ee4a6d90e.zip
Merge #6436 from ZyX-I/restart-includes-cleanup
Clean-up before restarting single-includes test
Diffstat (limited to 'ci/common')
-rw-r--r--ci/common/suite.sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/ci/common/suite.sh b/ci/common/suite.sh
index 5c79ce2718..46207754fa 100644
--- a/ci/common/suite.sh
+++ b/ci/common/suite.sh
@@ -57,13 +57,21 @@ run_test() {
run_test_wd() {
local timeout="$1"
test $# -gt 0 && shift
+
local cmd="$1"
test $# -gt 0 && shift
+
+ local restart_cmd="$1"
+ : ${restart_cmd:=true}
+ test $# -gt 0 && shift
+
local test_name="$1"
: ${test_name:=$cmd}
test $# -gt 0 && shift
+
local output_file="$(mktemp)"
local status_file="$(mktemp)"
+
local restarts=5
local prev_tmpsize=-1
while test $restarts -gt 0 ; do
@@ -88,10 +96,16 @@ run_test_wd() {
break
fi
done
+ restarts=$[ restarts - 1 ]
if test "$(stat -c "%s" "$status_file")" -eq 0 ; then
# status file not updated, assuming hang
kill -KILL $pid
- echo "Test ${test_name} hang up, restarting"
+ if test $restarts -eq 0 ; then
+ fail "${test_name}" E "Test hang up"
+ else
+ echo "Test ${test_name} hang up, restarting"
+ eval "$restart_cmd"
+ fi
else
local new_failed="$(cat "$status_file")"
if test "x$new_failed" != "x0" ; then
@@ -99,7 +113,6 @@ run_test_wd() {
fi
return 0
fi
- restarts=$[ restarts - 1 ]
done
}