Improve MaxScale startup and shutdown in NPM tests

The tests are now less violent in how they stop MaxScale. Also the logs
are now removed before a new test run is executed.
This commit is contained in:
Markus Mäkelä 2018-08-10 21:00:07 +03:00
parent 3bbf58ad1f
commit 064ad8fa4f
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
5 changed files with 8 additions and 23 deletions

View File

@ -1,6 +1,5 @@
[maxscale]
threads=4
log_info=1
libdir=@CMAKE_INSTALL_PREFIX@/@MAXSCALE_LIBDIR@
logdir=@CMAKE_INSTALL_PREFIX@/log/maxscale/
datadir=@CMAKE_INSTALL_PREFIX@/lib/maxscale

View File

@ -1,6 +1,5 @@
[maxscale]
threads=4
log_info=1
libdir=@CMAKE_INSTALL_PREFIX@/@MAXSCALE_LIBDIR@
logdir=@CMAKE_INSTALL_PREFIX@/secondary/log/maxscale/
datadir=@CMAKE_INSTALL_PREFIX@/secondary/lib/maxscale

View File

@ -18,6 +18,8 @@ testdir=$3
maxscaledir=$PWD/maxscale_test/
rm -f $maxscaledir/maxscale{,1,2}.output $maxscaledir/{,secondary/}log/maxscale/maxscale.log
# Create the test directories
mkdir -p $maxscaledir $testdir

View File

@ -1,20 +1,3 @@
#!/bin/bash
#
# This script is run after each test block. It kills the two MaxScale processes.
#
maxscaledir=$MAXSCALE_DIR
test -z "$MAXSCALE_DIR" && exit 1
for ((i=0;i<200;i++))
do
pkill '^maxscale$' || break
sleep 0.1
done
# If it wasn't dead before, now it is
pkill -9 '^maxscale$'
exit 0
./stop_maxscale.sh

View File

@ -8,13 +8,15 @@ maxscaledir=$MAXSCALE_DIR
test -z "$MAXSCALE_DIR" && exit 1
for ((i=0;i<200;i++))
pkill '^maxscale$'
for ((i=0;i<100;i++))
do
pkill '^maxscale$' || break
pgrep '^maxscale$' &> /dev/null || break
sleep 0.1
done
# If it wasn't dead before, now it is
pkill -9 '^maxscale$'
pgrep '^maxscale$' &> /dev/null && pkill -11 '^maxscale$'
exit 0