Skip to content

Commit

Permalink
Limit number of retries to 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Jan 19, 2017
1 parent a74ab7c commit f58dbe2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
10 changes: 6 additions & 4 deletions other/travis/env-linux.sh
Expand Up @@ -11,8 +11,10 @@ RUN() {
}

TESTS() {
# Keep running tests until they eventually succeed or Travis times out after
# 50 minutes. This cuts down on the time lost when tests fail, because we no
# longer need to manually restart the build and wait for compilation.
"$@" || TESTS "$@"
COUNT="$1"; shift
"$@" || {
if [ $COUNT -gt 1 ]; then
TESTS `expr $COUNT - 1` "$@"
fi
}
}
7 changes: 6 additions & 1 deletion other/travis/env-osx.sh
Expand Up @@ -10,5 +10,10 @@ RUN() {
}

TESTS() {
"$@"
COUNT="$1"; shift
"$@" || {
if [ $COUNT -gt 1 ]; then
TESTS `expr $COUNT - 1` "$@"
fi
}
}
2 changes: 2 additions & 0 deletions other/travis/env-windows.sh
Expand Up @@ -11,6 +11,8 @@ RUN() {
}

TESTS() {
shift # Ignore test run count.

# Download Microsoft DLLs.
curl http://www.dlldump.com/dllfiles/I/iphlpapi.dll -o _build/iphlpapi.dll
curl http://www.dlldump.com/dllfiles/W/ws2_32.dll -o _build/ws2_32.dll
Expand Down
1 change: 1 addition & 0 deletions other/travis/env.sh
Expand Up @@ -10,6 +10,7 @@ export CFLAGS="-O3 -DTRAVIS_ENV=1"
export CMAKE_EXTRA_FLAGS="-DERROR_ON_WARNING=ON -DBUILD_NTOX=ON"

BUILD_DIR=_build
MAX_TEST_RETRIES=3

# Workaround for broken Travis image.
export TERM=xterm
2 changes: 1 addition & 1 deletion other/travis/toxcore-script
Expand Up @@ -38,5 +38,5 @@ export CTEST_OUTPUT_ON_FAILURE=1

RUN make -C$BUILD_DIR -j$NPROC -k install
if $RUN_TESTS; then
TESTS make -C$BUILD_DIR -j$NPROC test ARGS="--rerun-failed"
TESTS $MAX_TEST_RETRIES make -C$BUILD_DIR -j$NPROC test ARGS="--rerun-failed"
fi

0 comments on commit f58dbe2

Please sign in to comment.