mirror of
https://github.com/postgres/postgres.git
synced 2025-10-20 00:04:28 -04:00
Slow hosts may avoid load-induced, spurious failures by setting environment variable PG_TEST_TIMEOUT_DEFAULT to some number of seconds greater than 180. Developers may see faster failures by setting that environment variable to some lesser number of seconds. In tests, write $PostgreSQL::Test::Utils::timeout_default wherever the convention has been to write 180. This change raises the default for some briefer timeouts. Back-patch to v10 (all supported versions). Discussion: https://postgr.es/m/20220218052842.GA3627003@rfd.leadboat.com
26 lines
565 B
Perl
26 lines
565 B
Perl
|
|
# Copyright (c) 2021-2022, PostgreSQL Global Development Group
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
use PostgreSQL::Test::Cluster;
|
|
use PostgreSQL::Test::Utils;
|
|
use Test::More;
|
|
|
|
program_help_ok('pg_isready');
|
|
program_version_ok('pg_isready');
|
|
program_options_handling_ok('pg_isready');
|
|
|
|
command_fails(['pg_isready'], 'fails with no server running');
|
|
|
|
my $node = PostgreSQL::Test::Cluster->new('main');
|
|
$node->init;
|
|
$node->start;
|
|
|
|
$node->command_ok(
|
|
[ 'pg_isready', "--timeout=$PostgreSQL::Test::Utils::timeout_default" ],
|
|
'succeeds with server running');
|
|
|
|
done_testing();
|