Test: more fix to 038.pcp_commands regression test. master
authorTatsuo Ishii <ishii@postgresql.org>
Fri, 27 Jun 2025 06:50:33 +0000 (15:50 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Fri, 27 Jun 2025 06:50:33 +0000 (15:50 +0900)
Commit 04e09df17 was not enough fix. The test calls pcp_proc_info()
pgpool_adm function along with user name and password (in the test
password is the same string as user name). Problem is, the user name
is obtained from a user name that runs the test, and we use psql -a to
submit the SQL, which prints the user name. Of course the user name
can vary depending on the environment, and it makes the test fail.  To
fix the issue, run psql without -a option.

src/test/regression/tests/038.pcp_commands/expected
src/test/regression/tests/038.pcp_commands/test.sh

index 861fabb87c52ce2003207544b5dbf655747c0d7f..61df0b9580616327ad150a0c978e3665be3bdeb2 100644 (file)
@@ -1,8 +1,4 @@
-CREATE EXTENSION pgpool_adm;
 CREATE EXTENSION
-SELECT database, status, case when client_host = '127.0.0.1' or client_host = '::1' then 'localhost' end, statement FROM pcp_proc_info
-(host => '', port => 11001, username => 't-ishii', password => 't-ishii')
-WHERE connected = '1' AND backend_id = '0' AND statement = 'SELECT pg_sleep(1)'
  database |     status      |   case    |     statement      
 ----------+-----------------+-----------+--------------------
  test     | Execute command | localhost | SELECT pg_sleep(1)
index 21896e44bbc0787077e3c6fd2b83d617e24585f8..89c4dbc92e133a12a203189533421669b051ba6e 100755 (executable)
@@ -58,7 +58,7 @@ WHOAMI=`whoami`
 ./startall
 wait_for_pgpool_startup
 $PSQL -a -h localhost -c "SELECT pg_sleep(1)" test &
-$PSQL -a -h localhost test > result 2>&1 <<EOF
+$PSQL -h localhost test > result 2>&1 <<EOF
 CREATE EXTENSION pgpool_adm;
 SELECT database, status, case when client_host = '127.0.0.1' or client_host = '::1' then 'localhost' end, statement FROM pcp_proc_info
 (host => '', port => $PCP_PORT, username => '$WHOAMI', password => '$WHOAMI')