pgpool2.git / summary / log / commit / refs
commit 2fc65c96d53bd85d40c3ae1ee5c5bd768ba474f2
Author: Tatsuo Ishii <ishii@sraoss.co.jp>
Date: Tue Dec 24 12:27:42 2019 +0000
Fix occasional regression test failure of 008.dbredirect.
In the test several databases are created and subsequent tests expect
that those databases have been already replicated. But it is possible
that the replication has not been done at that point and makes the
test fails. Fix is, add check the existence of database and if it's
not replicated, sleep for a while and retry it (up to 5 times).
src/test/regression/tests/008.dbredirect/test.sh | 28 ++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/src/test/regression/tests/008.dbredirect/test.sh b/src/test/regression/tests/008.dbredirect/test.sh
index 784bcbfb4..b577a9a3b 100755
--- a/src/test/regression/tests/008.dbredirect/test.sh
+++ b/src/test/regression/tests/008.dbredirect/test.sh
@@ -42,6 +42,34 @@ $CREATEDB test2
$CREATEDB test3
$CREATEDB test4
$CREATEDB test5
+
+# check to see if all databases have been replicated
+
+for p in 3 4
+do
+ # set standby port
+ myport=`expr $PGPOOL_PORT + $p`
+
+ for r in 1 2 3 4 5
+ do
+ ok=true
+ for i in mydb6 test2 test3 test4 test5
+ do
+ echo "try to connect to $i:$myport"
+ $PSQL -p $myport -c "select 1" $i
+ if [ $? != 0 ];then
+ ok=false
+ break
+ fi
+ done
+ if [ $ok = "false" ];then
+ sleep 1
+ else
+ break
+ fi
+ done
+done
+
$PGBENCH -i postgres
ok=yes
[parent: 638d2bbb0210]