Fix test failure of extended-query-test/disable-load-balance-while-function.data.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 13 Aug 2019 00:42:34 +0000 (09:42 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 13 Aug 2019 00:42:34 +0000 (09:42 +0900)
The test failed because CREATE function propagation to standby took a while.
To fix this, add "SELECT pg_sleep(5)" to wait for standby synced with primary.
Also expected file is updated to reflect this.
2) CREATE function propagation to standby took a while

src/test/extended-query-test/expected/disable-load-balance-white-function.data
src/test/extended-query-test/extra_scripts/disable-load-balance-white-function.data
src/test/extended-query-test/tests/disable-load-balance-white-function.data

index 3924da9e2648854e18539b97416bee5d38f22aa6..9197d0dd6836cace7d00c2e8531a0d89ddb594ef 100644 (file)
@@ -1,10 +1,15 @@
 FE=> Query (query="DROP FUNCTION IF EXISTS f1")
-<= BE NoticeResponse(S NOTICE V NOTICE C 00000 M function f1() does not exist, skipping F dropcmds.c L 483 R does_not_exist_skipping )
+<= BE NoticeResponse(S NOTICE V NOTICE C 00000 M function f1() does not exist, skipping F dropcmds.c L 491 R does_not_exist_skipping )
 <= BE CommandComplete(DROP FUNCTION)
 <= BE ReadyForQuery(I)
 FE=> Query (query="CREATE FUNCTION f1(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL")
 <= BE CommandComplete(CREATE FUNCTION)
 <= BE ReadyForQuery(I)
+FE=> Query (query="SELECT pg_sleep(5)")
+<= BE RowDescription
+<= BE DataRow
+<= BE CommandComplete(SELECT 1)
+<= BE ReadyForQuery(I)
 FE=> Parse(stmt="", query="BEGIN")
 FE=> Bind(stmt="", portal="")
 FE=> Execute(portal="")
index 549e5836dc3a9001cf41c704b94bb20f2a15da16..a0b04a1fa824c0cacbd7da600079046ea332329c 100755 (executable)
@@ -5,7 +5,7 @@
 # Parse: 1 Execute: 1 Parse: 1 Execute: 1
 set 0 1 1 1 1 1 1 1 1 1 1 1 1 1
 
-grep "SELECT" $PGPOOLLOG | grep -v version |awk '{print $9}' | while read node
+grep "SELECT" $PGPOOLLOG | grep -v version | grep -v pg_sleep | awk '{print $9}' | while read node
 do
     if [ $1 -ne $node ]
     then
index 17d493c7b26796be272452ec26b5157a9a84e51a..6399a903d26d0f981732c5050a944df3271361f8 100644 (file)
 'Q'    "CREATE FUNCTION f1(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL"
 'Y'
 
+# Wait a while to the standby synced with primary.
+'Q'    "SELECT pg_sleep(5)"
+'Y'
+
 # Start a transaction
 'P'    ""      "BEGIN" 0
 'B'    ""      ""      0       0       0