1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-08 06:02:22 +03:00

Unify PostgresNode's new() and get_new_node() methods

There is only one constructor now for PostgresNode, with the idiomatic
name 'new'. The method is not exported by the class, and must be called
as "PostgresNode->new('name',[args])". All the TAP tests that use
PostgresNode are modified accordingly. Third party scripts will need
adjusting, which is a fairly mechanical process (I just used a sed
script).
This commit is contained in:
Andrew Dunstan
2021-07-29 05:58:08 -04:00
parent dbfe6e4b17
commit 201a76183e
109 changed files with 212 additions and 238 deletions

View File

@@ -14,7 +14,7 @@ my $tempdir_short = TestLib::tempdir_short;
command_exit_is([ 'pg_ctl', 'status', '-D', "$tempdir/nonexistent" ],
4, 'pg_ctl status with nonexistent directory');
my $node = get_new_node('main');
my $node = PostgresNode->new('main');
$node->init;
command_exit_is([ 'pg_ctl', 'status', '-D', $node->data_dir ],

View File

@@ -15,7 +15,7 @@ command_fails_like(
qr/directory .* does not exist/,
'pg_ctl promote with nonexistent directory');
my $node_primary = get_new_node('primary');
my $node_primary = PostgresNode->new('primary');
$node_primary->init(allows_streaming => 1);
command_fails_like(
@@ -30,7 +30,7 @@ command_fails_like(
qr/not in standby mode/,
'pg_ctl promote of primary instance fails');
my $node_standby = get_new_node('standby');
my $node_standby = PostgresNode->new('standby');
$node_primary->backup('my_backup');
$node_standby->init_from_backup($node_primary, 'my_backup',
has_streaming => 1);
@@ -47,7 +47,7 @@ ok( $node_standby->poll_query_until(
'promoted standby is not in recovery');
# same again with default wait option
$node_standby = get_new_node('standby2');
$node_standby = PostgresNode->new('standby2');
$node_standby->init_from_backup($node_primary, 'my_backup',
has_streaming => 1);
$node_standby->start;

View File

@@ -10,7 +10,7 @@ use Test::More tests => 5;
use Time::HiRes qw(usleep);
# Set up node with logging collector
my $node = get_new_node('primary');
my $node = PostgresNode->new('primary');
$node->init();
$node->append_conf(
'postgresql.conf', qq(