testbench: wait function needs to support slow machines

This commit is contained in:
Rainer Gerhards 2018-11-12 13:34:02 +01:00
parent c186a1c03b
commit 04f792de8d
No known key found for this signature in database
GPG Key ID: 0CB6B2A8BE80B499
2 changed files with 15 additions and 1 deletions

View File

@ -72,7 +72,7 @@ export ZOOPIDFILE="$(pwd)/zookeeper.pid"
#export RSYSLOG_DEBUG="debug nologfuncflow noprintmutexaction nostdout"
#export RSYSLOG_DEBUGLOG="log"
TB_TIMEOUT_STARTSTOP=400 # timeout for start/stop rsyslogd in tenths (!) of a second 400 => 40 sec
TB_TEST_TIMEOUT=60 # number of seconds after which test checks timeout (eg. waits)
TB_TEST_TIMEOUT=90 # number of seconds after which test checks timeout (eg. waits)
# note that 40sec for the startup should be sufficient even on very slow machines. we changed this from 2min on 2017-12-12
export RSYSLOG_DEBUG_TIMEOUTS_TO_STDERR="on" # we want to know when we loose messages due to timeouts
if [ "$TESTTOOL_DIR" == "" ]; then
@ -120,6 +120,19 @@ tb_timestamp() {
date +%H:%M:%S
}
# override the test timeout, but only if the new value is higher
# than the previous one. This is necessary for slow test systems
# $1 is timeout in seconds
override_test_timeout() {
if [ "${1:=0}" == "" ]; then
printf 'FAIL: invalid testbench call, override_test_timeout needs value\n'
error_exit 100
fi
if [ "$1" -gt "$TB_TEST_TIMEOUT" ]; then
TB_TEST_TIMEOUT=$1
printf 'info: TB_TEST_TIMEOUT increased to %s\n' "$TB_TEST_TIMEOUT"
fi
}
# set special tests status. States ($1) are:
# unreliable -- as the name says, test does not work reliably; $2 must be github issue URL

View File

@ -4,6 +4,7 @@
export ES_PORT=19200
export NUMMESSAGES=100
override_test_timeout 120
#export USE_VALGRIND="YES" # to enable this to run under valgrind
download_elasticsearch