pgpool2.git / summary / log / commit / refs
commit 48fc19dbffb7b67c3f9088ff8b133a54f880a9e8
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Sat Apr 05 22:48:09 2014 +0000
Fix test driver for watchdog to use wait_for_pgpool_startup correctly.
It does not source bashrc.ports and does not use correct pgpool port
number.
src/test/regression/tests/004.watchdog/test.sh | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/test/regression/tests/004.watchdog/test.sh b/src/test/regression/tests/004.watchdog/test.sh
index 31dfa11ed..ec1db6ffe 100755
--- a/src/test/regression/tests/004.watchdog/test.sh
+++ b/src/test/regression/tests/004.watchdog/test.sh
@@ -12,6 +12,7 @@ cd $TESTDIR
echo -n "creating master pgpool..."
sh $PGPOOL_SETUP -m s -n 2 -p 11000|| exit 1
echo "done."
+source ./bashrc.ports
cat ../master.conf >> etc/pgpool.conf
./startall
@@ -27,6 +28,7 @@ cd $sdir
echo -n "creating standby pgpool..."
sh $PGPOOL_SETUP -m s -n 2 -p 11100|| exit 1
echo "done."
+source ./bashrc.ports
cat ../standby.conf >> etc/pgpool.conf
egrep 'backend_data_directory0|backend_data_directory1|failover_command|follow_master_command' ../$TESTDIR/etc/pgpool.conf >> etc/pgpool.conf
./startall
@@ -36,9 +38,15 @@ cd ..
# stop master pgpool and see if standby take over
$PGPOOL_INSTALL_DIR/bin/pgpool -f master/etc/pgpool.conf -m f stop
-sleep 1
-
-RESULT=`grep "wd_escalation: escalated to master pgpool successfully" standby/log/pgpool.log`
+echo "Standby pgpool-II is detecting master went down and is escalating to master..."
+for i in 1 2 3 4 5 6 7 8 9 10
+do
+ RESULT=`grep "wd_escalation: escalated to master pgpool successfully" standby/log/pgpool.log`
+ if [ ! -z "$RESULT" ]; then
+ echo "Master escalation done."
+ break;
+ fi
+done
cd master
./shutdownall
[parent: aa3aa94797f9]