Fix occasional regression test 003.failover failure.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 31 Dec 2019 03:06:50 +0000 (12:06 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 31 Dec 2019 03:20:46 +0000 (12:20 +0900)
The test compares the result of show pool_nodes against pre-computed
expected text file. After primary node goes down and old standby
promotes to primary, it is possible that streaming replication worker
process stores the replication state (async, streaming) in shared
memory before the failover but fails to update the state after the
failover. Fix is, replace "async", "streaming" with space characters
in the result file to match the expected file.

src/test/regression/tests/003.failover/test.sh

index de076415e8485fc8acd2cd1995edcd90be2ea592..453a71212b4d619beefb1735284178ac5ec47fbf 100755 (executable)
@@ -27,7 +27,8 @@ do
        # trigger failover on node 1
        $PG_CTL -D data1 -m f stop
        wait_for_pgpool_startup
-       $PSQL -c "show pool_nodes" test |sed -e 's/true /false/'> result
+       $PSQL -c "show pool_nodes" test |sed -e 's/true /false/' -e 's/....-..-.. ..:..:../XXXX-XX-XX XX:XX:XX/g'|
+           sed -e 's/streaming/         /' | sed -e 's/async/     /'> result
 
        # check the output of "show pool_nodes".
        LANG=C $PSQL -f ../create_expected.sql -v mode="'$mode'" -v dir="'$PGSOCKET_DIR'" test | tail -n 6 > expected