Skip to content

Commit 201a761

Browse files
committed
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).
1 parent dbfe6e4 commit 201a761

File tree

109 files changed

+212
-238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+212
-238
lines changed

contrib/amcheck/t/001_verify_heapam.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#
1616
# Test set-up
1717
#
18-
$node = get_new_node('test');
18+
$node = PostgresNode->new('test');
1919
$node->init;
2020
$node->append_conf('postgresql.conf', 'autovacuum=off');
2121
$node->start;

contrib/auto_explain/t/001_auto_explain.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use TestLib;
99
use Test::More tests => 4;
1010

11-
my $node = get_new_node('main');
11+
my $node = PostgresNode->new('main');
1212
$node->init;
1313
$node->append_conf('postgresql.conf',
1414
"shared_preload_libraries = 'auto_explain'");

contrib/bloom/t/001_wal.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ sub test_index_replay
4343
}
4444

4545
# Initialize primary node
46-
$node_primary = get_new_node('primary');
46+
$node_primary = PostgresNode->new('primary');
4747
$node_primary->init(allows_streaming => 1);
4848
$node_primary->start;
4949
my $backup_name = 'my_backup';
@@ -52,7 +52,7 @@ sub test_index_replay
5252
$node_primary->backup($backup_name);
5353

5454
# Create streaming standby linking to primary
55-
$node_standby = get_new_node('standby');
55+
$node_standby = PostgresNode->new('standby');
5656
$node_standby->init_from_backup($node_primary, $backup_name,
5757
has_streaming => 1);
5858
$node_standby->start;

contrib/test_decoding/t/001_repl_stats.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Test::More tests => 2;
1212

1313
# Test set-up
14-
my $node = get_new_node('test');
14+
my $node = PostgresNode->new('test');
1515
$node->init(allows_streaming => 'logical');
1616
$node->append_conf('postgresql.conf', 'synchronous_commit = on');
1717
$node->start;

src/bin/pg_amcheck/t/002_nonesuch.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# Test set-up
1212
my ($node, $port);
13-
$node = get_new_node('test');
13+
$node = PostgresNode->new('test');
1414
$node->init;
1515
$node->start;
1616
$port = $node->port;

src/bin/pg_amcheck/t/003_check.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ ()
120120
}
121121

122122
# Test set-up
123-
$node = get_new_node('test');
123+
$node = PostgresNode->new('test');
124124
$node->init;
125125
$node->append_conf('postgresql.conf', 'autovacuum=off');
126126
$node->start;

src/bin/pg_amcheck/t/004_verify_heapam.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ sub write_tuple
178178
# Set up the node. Once we create and corrupt the table,
179179
# autovacuum workers visiting the table could crash the backend.
180180
# Disable autovacuum so that won't happen.
181-
my $node = get_new_node('test');
181+
my $node = PostgresNode->new('test');
182182
$node->init;
183183
$node->append_conf('postgresql.conf', 'autovacuum=off');
184184

src/bin/pg_amcheck/t/005_opclass_damage.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use TestLib;
1111
use Test::More tests => 5;
1212

13-
my $node = get_new_node('test');
13+
my $node = PostgresNode->new('test');
1414
$node->init;
1515
$node->start;
1616

src/bin/pg_basebackup/t/010_pg_basebackup.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
my $tempdir = TestLib::tempdir;
2020

21-
my $node = get_new_node('main');
21+
my $node = PostgresNode->new('main');
2222

2323
# Set umask so test directories and files are created with default permissions
2424
umask(0077);
@@ -268,7 +268,7 @@
268268
skip "no tar program available", 1
269269
if (!defined $tar || $tar eq '');
270270

271-
my $node2 = get_new_node('replica');
271+
my $node2 = PostgresNode->new('replica');
272272

273273
# Recover main data directory
274274
$node2->init_from_backup($node, 'tarbackup2', tar_program => $tar);

src/bin/pg_basebackup/t/020_pg_receivewal.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Set umask so test directories and files are created with default permissions
1515
umask(0077);
1616

17-
my $primary = get_new_node('primary');
17+
my $primary = PostgresNode->new('primary');
1818
$primary->init(allows_streaming => 1);
1919
$primary->start;
2020

0 commit comments

Comments
 (0)