]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Handle timeout in PostgreSQL::Test::Cluster::is_alive()
authorMichael Paquier <michael@paquier.xyz>
Tue, 29 Jul 2025 08:03:07 +0000 (17:03 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 29 Jul 2025 08:03:07 +0000 (17:03 +0900)
This commit adds an extra --timeout=PG_TEST_TIMEOUT_DEFAULT to the call
of pg_isready done in is_alive(), so as it is possible to have more
leverage with the call on machines constrained on resources.

By default the timeout is 180s, and it can be changed depending on the
environment where the tests are run.

Per buildfarm member mamba, where the default timeout of 3s used by
pg_isready has proved that it may not be enough as the postmaster may
not have the time it needs to reply to a ping request.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com>
Discussion: https://postgr.es/m/29b637df-f818-4b52-986a-f11ba28300e9@gmail.com

src/test/perl/PostgreSQL/Test/Cluster.pm

index 61f68e0cc2e513d0f0c2854c0d927a97efb62447..35413f140198bf42340cfa204bfb97819ecce8c8 100644 (file)
@@ -304,6 +304,7 @@ sub is_alive
 
        my $ret = PostgreSQL::Test::Utils::system_log(
                'pg_isready',
+               '--timeout' => $PostgreSQL::Test::Utils::timeout_default,
                '--host' => $self->host,
                '--port' => $self->port);