Debian Codegraph @

src/bin/scripts/t/080_pg_isready.pl

raw
1
2 # Copyright (c) 2021-2025, PostgreSQL Global Development Group
3
4 use strict;
5 use warnings FATAL => 'all';
6
7 use PostgreSQL::Test::Cluster;
8 use PostgreSQL::Test::Utils;
9 use Test::More;
10
11 program_help_ok('pg_isready');
12 program_version_ok('pg_isready');
13 program_options_handling_ok('pg_isready');
14
15 my $node = PostgreSQL::Test::Cluster->new('main');
16 $node->init;
17
18 $node->command_fails(['pg_isready'], 'fails with no server running');
19
20 $node->start;
21
22 $node->command_ok(
23 [
24 'pg_isready',
25 '--timeout' => $PostgreSQL::Test::Utils::timeout_default,
26 ],
27 'succeeds with server running');
28
29 done_testing();