From: Tatsuo Ishii Date: Wed, 13 Sep 2023 08:51:21 +0000 (+0900) Subject: Test: attempt to fix 001.load_balance test timeout. X-Git-Tag: V4_5_0_BETA1~23 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=fb0800e3f0211ba833ca05cf506387e4d2a279b8;p=pgpool2.git Test: attempt to fix 001.load_balance test timeout. Examining the log reveals that the error was caused by bind error: address already used. This is strange because SO_REUSEADDR flags is set to the listening socket. I guess the cause is, the kernel is not fast enough to clean up the socket used by previous pgpool process. To fix this, existing CHECK_TIME_WAIT environment variable parameter is modified so that it checks the socket by using netstat -tulpn, rather than netstat -a, which is too slow. --- diff --git a/src/test/pgpool_setup.in b/src/test/pgpool_setup.in index 879d02d80..3823d85f2 100644 --- a/src/test/pgpool_setup.in +++ b/src/test/pgpool_setup.in @@ -1320,7 +1320,7 @@ echo 'dir=`pwd`' > $SHUTDOWNALL echo "PGPOOL_INSTALL_DIR=$PGPOOL_INSTALL_DIR" >> $SHUTDOWNALL echo '$PGPOOL_INSTALL_DIR/bin/pgpool -f $dir/etc/pgpool.conf -m f stop && while [ -f $dir/run/pgpool.pid ];do sleep 1;done' >> $SHUTDOWNALL if [ $CHECK_TIME_WAIT != "false" ];then - echo "while netstat -a|grep $ORIGBASEPORT ;do sleep 1;done" >> $SHUTDOWNALL + echo "while netstat -tulpn 2>/dev/null|grep pgpool|grep -w $ORIGBASEPORT ;do sleep 1;done" >> $SHUTDOWNALL fi chmod 755 $SHUTDOWNALL echo 'dir=`pwd`' > $PGPOOL_RELOAD diff --git a/src/test/regression/tests/001.load_balance/test.sh b/src/test/regression/tests/001.load_balance/test.sh index 20262a178..c3bad5482 100755 --- a/src/test/regression/tests/001.load_balance/test.sh +++ b/src/test/regression/tests/001.load_balance/test.sh @@ -8,6 +8,7 @@ PSQL=$PGBIN/psql PSQLOPTS="-a -q -X" PGPOOLBIN=$PGPOOL_INSTALL_DIR/bin export PGDATABASE=test +export CHECK_TIME_WAIT=true # sleep time after reload in seconds st=10