]> granicus.if.org Git - pgbouncer/commitdiff
Fix test_server_login_retry stability
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 7 Oct 2019 20:02:08 +0000 (22:02 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 7 Oct 2019 20:02:08 +0000 (22:02 +0200)
The problem is that server_login_retry is only applied when the
backend server is down, but not when it returns an error upon
connection (e.g., authentication error).  In that case, the client
sees the error immediately.  Be that as it may, it breaks this test
sometimes, if a retry attempt hits the window where the server reports
"database is starting up".  (This window should be tiny since no
notable recovery should be happening here, but it happens.)  To fix,
adjust the settings so that the retries happen well away from the
backend server startup phase.

test/test.sh

index 52c2f6c8bdb065c5480f45d82bc1632e1a2d85cd..2d1555c3e45232755e9b2f56fbc1eeec80bc69ba 100755 (executable)
@@ -313,10 +313,10 @@ test_client_idle_timeout() {
 # server_login_retry
 test_server_login_retry() {
        admin "set query_timeout=10"
-       admin "set server_login_retry=1"
+       admin "set server_login_retry=3"
 
-       (pgctl -m fast stop; sleep 3; pgctl start) &
-       sleep 1
+       pgctl -m fast stop
+       (sleep 1; pgctl start) &
        psql -X -c "select now()" p0
        rc=$?
        wait