Test: add check using netstat.
authorTatsuo Ishii <ishii@postgresql.org>
Mon, 2 Dec 2024 05:49:08 +0000 (14:49 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Mon, 2 Dec 2024 05:49:08 +0000 (14:49 +0900)
Sometimes we see regression errors like:
2024-12-01 13:55:55.508: watchdog pid 27340: FATAL:  failed to create watchdog receive socket
2024-12-01 13:55:55.508: watchdog pid 27340: DETAIL:  bind on "TCP:50002" failed with reason: "Address already in use"

Before starting each regression test, we use "clean_all" script to
kill all remaining process.  I suspect that this is not enough to
release bound ports. So I add netstat command to check whether some
ports are remain bound.

For not this commit is master branch only.

src/test/regression/libs.sh

index 6cd55a922c96abd0fa862bff2e327920fdcc3a5b..7c5a0c1821191a572430b658d80ab34554110363 100644 (file)
@@ -43,6 +43,7 @@ function clean_all {
        pgrep pgpool | xargs kill -9 > /dev/null 2>&1
        pgrep postgres | xargs kill -9 > /dev/null 2>&1
        rm -f $PGSOCKET_DIR/.s.PGSQL.*
+       netstat -t -p 2>/dev/null|grep pgpool
 }
 
 #-------------------------------------------