Fix regression test 028.watchdog_enable_consensus_with_half_of_the_votes to not fail.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Thu, 5 Sep 2019 04:40:02 +0000 (13:40 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Thu, 5 Sep 2019 04:40:02 +0000 (13:40 +0900)
It seems pcp_watchdog_info fails because:
ERROR: connection to socket "/tmp/.s.PGSQL.50001" failed with error "No such file or directory"

Fix could be trying to wait for pcp_watchdog_info available. See if this fixes the issue.

src/test/regression/tests/028.watchdog_enable_consensus_with_half_of_the_votes/test.sh

index ba033bb95fac4ab95654d3bb7d2c0bdcaccf1911..28b25b16a4b4061bb140c87f2f66d3b69b6f30f8 100755 (executable)
@@ -34,6 +34,20 @@ function wait_for_watchdog_startup
 # retun 0 if quorum exists.
 function quorum_exists
 {
+    $PGPOOL_INSTALL_DIR/bin/pcp_watchdog_info -v -w -p $PCP_PORT >/dev/null 2>&1
+    if [ $? != 0 ];then
+       echo "pcp_watchdog_info is not still available"
+       for i in 1 2 3 4 5
+       do
+           $PGPOOL_INSTALL_DIR/bin/pcp_watchdog_info -v -w -p $PCP_PORT >/dev/null 2>&1
+           if [ $? = 0 ];then
+               break;
+           fi
+           echo "waiting for pcp_watchdog_info becomes available"
+           sleep 1
+       done
+    fi
+
     $PGPOOL_INSTALL_DIR/bin/pcp_watchdog_info -v -w -p $PCP_PORT |grep QUORUM|egrep 'EXIST|EDGE'>/dev/null
 }