diff options
Diffstat (limited to 'src/test')
65 files changed, 158 insertions, 184 deletions
diff --git a/src/test/authentication/t/001_password.pl b/src/test/authentication/t/001_password.pl index 427a3601987..9498c18d7d1 100644 --- a/src/test/authentication/t/001_password.pl +++ b/src/test/authentication/t/001_password.pl @@ -62,7 +62,7 @@ sub test_role } # Initialize primary node -my $node = get_new_node('primary'); +my $node = PostgresNode->new('primary'); $node->init; $node->append_conf('postgresql.conf', "log_connections = on\n"); $node->start; diff --git a/src/test/authentication/t/002_saslprep.pl b/src/test/authentication/t/002_saslprep.pl index f080a0ccbae..4799e927dbb 100644 --- a/src/test/authentication/t/002_saslprep.pl +++ b/src/test/authentication/t/002_saslprep.pl @@ -62,7 +62,7 @@ sub test_login # Initialize primary node. Force UTF-8 encoding, so that we can use non-ASCII # characters in the passwords below. -my $node = get_new_node('primary'); +my $node = PostgresNode->new('primary'); $node->init(extra => [ '--locale=C', '--encoding=UTF8' ]); $node->start; diff --git a/src/test/kerberos/t/001_auth.pl b/src/test/kerberos/t/001_auth.pl index b5594924cae..d6191498f09 100644 --- a/src/test/kerberos/t/001_auth.pl +++ b/src/test/kerberos/t/001_auth.pl @@ -167,7 +167,7 @@ END note "setting up PostgreSQL instance"; -my $node = get_new_node('node'); +my $node = PostgresNode->new('node'); $node->init; $node->append_conf( 'postgresql.conf', qq{ diff --git a/src/test/ldap/t/001_auth.pl b/src/test/ldap/t/001_auth.pl index 0ae14e4c85f..553041baa2b 100644 --- a/src/test/ldap/t/001_auth.pl +++ b/src/test/ldap/t/001_auth.pl @@ -153,7 +153,7 @@ system_or_bail 'ldappasswd', '-x', '-y', $ldap_pwfile, '-s', 'secret2', note "setting up PostgreSQL instance"; -my $node = get_new_node('node'); +my $node = PostgresNode->new('node'); $node->init; $node->append_conf('postgresql.conf', "log_connections = on\n"); $node->start; diff --git a/src/test/modules/brin/t/01_workitems.pl b/src/test/modules/brin/t/01_workitems.pl index a4f603a9d54..ea2e2944a15 100644 --- a/src/test/modules/brin/t/01_workitems.pl +++ b/src/test/modules/brin/t/01_workitems.pl @@ -10,7 +10,7 @@ use TestLib; use Test::More tests => 2; use PostgresNode; -my $node = get_new_node('tango'); +my $node = PostgresNode->new('tango'); $node->init; $node->append_conf('postgresql.conf', 'autovacuum_naptime=1s'); $node->start; diff --git a/src/test/modules/commit_ts/t/001_base.pl b/src/test/modules/commit_ts/t/001_base.pl index dd41936658d..0c504421d44 100644 --- a/src/test/modules/commit_ts/t/001_base.pl +++ b/src/test/modules/commit_ts/t/001_base.pl @@ -10,7 +10,7 @@ use TestLib; use Test::More tests => 2; use PostgresNode; -my $node = get_new_node('foxtrot'); +my $node = PostgresNode->new('foxtrot'); $node->init; $node->append_conf('postgresql.conf', 'track_commit_timestamp = on'); $node->start; diff --git a/src/test/modules/commit_ts/t/002_standby.pl b/src/test/modules/commit_ts/t/002_standby.pl index 2664b177ec2..227eddeda26 100644 --- a/src/test/modules/commit_ts/t/002_standby.pl +++ b/src/test/modules/commit_ts/t/002_standby.pl @@ -11,7 +11,7 @@ use Test::More tests => 4; use PostgresNode; my $bkplabel = 'backup'; -my $primary = get_new_node('primary'); +my $primary = PostgresNode->new('primary'); $primary->init(allows_streaming => 1); $primary->append_conf( @@ -22,7 +22,7 @@ $primary->append_conf( $primary->start; $primary->backup($bkplabel); -my $standby = get_new_node('standby'); +my $standby = PostgresNode->new('standby'); $standby->init_from_backup($primary, $bkplabel, has_streaming => 1); $standby->start; diff --git a/src/test/modules/commit_ts/t/003_standby_2.pl b/src/test/modules/commit_ts/t/003_standby_2.pl index 57ab9b1d463..27c5bfbfb73 100644 --- a/src/test/modules/commit_ts/t/003_standby_2.pl +++ b/src/test/modules/commit_ts/t/003_standby_2.pl @@ -11,7 +11,7 @@ use Test::More tests => 4; use PostgresNode; my $bkplabel = 'backup'; -my $primary = get_new_node('primary'); +my $primary = PostgresNode->new('primary'); $primary->init(allows_streaming => 1); $primary->append_conf( 'postgresql.conf', qq{ @@ -21,7 +21,7 @@ $primary->append_conf( $primary->start; $primary->backup($bkplabel); -my $standby = get_new_node('standby'); +my $standby = PostgresNode->new('standby'); $standby->init_from_backup($primary, $bkplabel, has_streaming => 1); $standby->start; diff --git a/src/test/modules/commit_ts/t/004_restart.pl b/src/test/modules/commit_ts/t/004_restart.pl index bc9931944f3..5d92c5a2e6d 100644 --- a/src/test/modules/commit_ts/t/004_restart.pl +++ b/src/test/modules/commit_ts/t/004_restart.pl @@ -8,7 +8,7 @@ use PostgresNode; use TestLib; use Test::More tests => 16; -my $node_primary = get_new_node('primary'); +my $node_primary = PostgresNode->new('primary'); $node_primary->init(allows_streaming => 1); $node_primary->append_conf('postgresql.conf', 'track_commit_timestamp = on'); $node_primary->start; diff --git a/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl b/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl index 4101ef950ee..49f211c8270 100644 --- a/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl +++ b/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl @@ -9,7 +9,7 @@ use PostgresNode; use TestLib; use Test::More; -my $node = get_new_node('main'); +my $node = PostgresNode->new('main'); $node->init; $node->start; diff --git a/src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl b/src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl index 1e2455e82f3..0a45fc1b75e 100644 --- a/src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl +++ b/src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl @@ -20,7 +20,7 @@ my $rot13pass = "SbbOnE1"; # see the Makefile for how the certificate and key have been generated -my $node = get_new_node('main'); +my $node = PostgresNode->new('main'); $node->init; $node->append_conf('postgresql.conf', "ssl_passphrase.passphrase = '$rot13pass'"); diff --git a/src/test/modules/test_misc/t/001_constraint_validation.pl b/src/test/modules/test_misc/t/001_constraint_validation.pl index 3729906c1ac..7c1929f8053 100644 --- a/src/test/modules/test_misc/t/001_constraint_validation.pl +++ b/src/test/modules/test_misc/t/001_constraint_validation.pl @@ -10,7 +10,7 @@ use TestLib; use Test::More tests => 42; # Initialize a test cluster -my $node = get_new_node('primary'); +my $node = PostgresNode->new('primary'); $node->init(); # Turn message level up to DEBUG1 so that we get the messages we want to see $node->append_conf('postgresql.conf', 'client_min_messages = DEBUG1'); diff --git a/src/test/modules/test_pg_dump/t/001_base.pl b/src/test/modules/test_pg_dump/t/001_base.pl index 8511da5169b..ea7739d7254 100644 --- a/src/test/modules/test_pg_dump/t/001_base.pl +++ b/src/test/modules/test_pg_dump/t/001_base.pl @@ -713,7 +713,7 @@ my %tests = ( ######################################### # Create a PG instance to test actually dumping from -my $node = get_new_node('main'); +my $node = PostgresNode->new('main'); $node->init; $node->start; diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm index 92319452167..45c69a61baf 100644 --- a/src/test/perl/PostgresNode.pm +++ b/src/test/perl/PostgresNode.pm @@ -11,7 +11,7 @@ PostgresNode - class representing PostgreSQL server instance use PostgresNode; - my $node = PostgresNode->get_new_node('mynode'); + my $node = PostgresNode->new('mynode'); # Create a data directory with initdb $node->init(); @@ -61,9 +61,9 @@ PostgresNode - class representing PostgreSQL server instance my $ret = $node->backup_fs_cold('testbackup3') # Restore it to create a new independent node (not a replica) - my $replica = get_new_node('replica'); - $replica->init_from_backup($node, 'testbackup'); - $replica->start; + my $other_node = PostgresNode->new('mycopy'); + $other_node->init_from_backup($node, 'testbackup'); + $other_node->start; # Stop the server $node->stop('fast'); @@ -110,7 +110,6 @@ use Time::HiRes qw(usleep); use Scalar::Util qw(blessed); our @EXPORT = qw( - get_new_node get_free_port ); @@ -139,41 +138,6 @@ INIT =over -=item PostgresNode::new($class, $name, $pghost, $pgport) - -Create a new PostgresNode instance. Does not initdb or start it. - -You should generally prefer to use get_new_node() instead since it takes care -of finding port numbers, registering instances for cleanup, etc. - -=cut - -sub new -{ - my ($class, $name, $pghost, $pgport) = @_; - my $testname = basename($0); - $testname =~ s/\.[^.]+$//; - my $self = { - _port => $pgport, - _host => $pghost, - _basedir => "$TestLib::tmp_check/t_${testname}_${name}_data", - _name => $name, - _logfile_generation => 0, - _logfile_base => "$TestLib::log_path/${testname}_${name}", - _logfile => "$TestLib::log_path/${testname}_${name}.log" - }; - - bless $self, $class; - mkdir $self->{_basedir} - or - BAIL_OUT("could not create data directory \"$self->{_basedir}\": $!"); - $self->dump_info; - - return $self; -} - -=pod - =item $node->port() Get the port number assigned to the host. This won't necessarily be a TCP port @@ -1168,15 +1132,13 @@ sub _update_pid =pod -=item PostgresNode->get_new_node(node_name, %params) +=item PostgresNode->new(node_name, %params) Build a new object of class C<PostgresNode> (or of a subclass, if you have one), assigning a free port number. Remembers the node, to prevent its port number from being reused for another node, and to ensure that it gets shut down when the test script exits. -You should generally use this instead of C<PostgresNode::new(...)>. - =over =item port => [1,65535] @@ -1201,15 +1163,11 @@ not provided, Postgres binaries will be found in the caller's PATH. =back -For backwards compatibility, it is also exported as a standalone function, -which can only create objects of class C<PostgresNode>. - =cut -sub get_new_node +sub new { - my $class = 'PostgresNode'; - $class = shift if scalar(@_) % 2 != 1; + my $class = shift; my ($name, %params) = @_; # Select a port. @@ -1244,14 +1202,30 @@ sub get_new_node } } - # Lock port number found by creating a new node - my $node = $class->new($name, $host, $port); + my $testname = basename($0); + $testname =~ s/\.[^.]+$//; + my $node = { + _port => $port, + _host => $host, + _basedir => "$TestLib::tmp_check/t_${testname}_${name}_data", + _name => $name, + _logfile_generation => 0, + _logfile_base => "$TestLib::log_path/${testname}_${name}", + _logfile => "$TestLib::log_path/${testname}_${name}.log" + }; if ($params{install_path}) { $node->{_install_path} = $params{install_path}; } + bless $node, $class; + mkdir $node->{_basedir} + or + BAIL_OUT("could not create data directory \"$node->{_basedir}\": $!"); + + $node->dump_info; + # Add node to list of nodes push(@all_nodes, $node); @@ -1322,7 +1296,7 @@ sub _set_pg_version # the remainder are# set. Then the PATH and (DY)LD_LIBRARY_PATH are adjusted # if the node's install path is set, and the copy environment is returned. # -# The install path set in get_new_node needs to be a directory containing +# The install path set in new() needs to be a directory containing # bin and lib subdirectories as in a standard PostgreSQL installation, so this # can't be used with installations where the bin and lib directories don't have # a common parent directory. @@ -1407,7 +1381,7 @@ sub installed_command =item get_free_port() Locate an unprivileged (high) TCP port that's not currently bound to -anything. This is used by get_new_node, and is also exported for use +anything. This is used by new(), and is also exported for use by test cases that need to start other, non-Postgres servers. Ports assigned to existing PostgresNode objects are automatically diff --git a/src/test/perl/README b/src/test/perl/README index fd9394957f7..f04b2a2ea49 100644 --- a/src/test/perl/README +++ b/src/test/perl/README @@ -48,7 +48,7 @@ Each test script should begin with: then it will generally need to set up one or more nodes, run commands against them and evaluate the results. For example: - my $node = PostgresNode->get_new_node('primary'); + my $node = PostgresNode->new('primary'); $node->init; $node->start; diff --git a/src/test/recovery/t/001_stream_rep.pl b/src/test/recovery/t/001_stream_rep.pl index df6fdc20d1e..ac581c1c078 100644 --- a/src/test/recovery/t/001_stream_rep.pl +++ b/src/test/recovery/t/001_stream_rep.pl @@ -9,7 +9,7 @@ use TestLib; use Test::More tests => 49; # Initialize primary node -my $node_primary = get_new_node('primary'); +my $node_primary = PostgresNode->new('primary'); # A specific role is created to perform some tests related to replication, # and it needs proper authentication configuration. $node_primary->init( @@ -22,7 +22,7 @@ my $backup_name = 'my_backup'; $node_primary->backup($backup_name); # Create streaming standby linking to primary -my $node_standby_1 = get_new_node('standby_1'); +my $node_standby_1 = PostgresNode->new('standby_1'); $node_standby_1->init_from_backup($node_primary, $backup_name, has_streaming => 1); $node_standby_1->start; @@ -37,7 +37,7 @@ $node_standby_1->backup('my_backup_2'); $node_primary->start; # Create second standby node linking to standby 1 -my $node_standby_2 = get_new_node('standby_2'); +my $node_standby_2 = PostgresNode->new('standby_2'); $node_standby_2->init_from_backup($node_standby_1, $backup_name, has_streaming => 1); $node_standby_2->start; diff --git a/src/test/recovery/t/002_archiving.pl b/src/test/recovery/t/002_archiving.pl index c675c0886cd..ce60159f036 100644 --- a/src/test/recovery/t/002_archiving.pl +++ b/src/test/recovery/t/002_archiving.pl @@ -10,7 +10,7 @@ use Test::More tests => 3; use File::Copy; # Initialize primary node, doing archives -my $node_primary = get_new_node('primary'); +my $node_primary = PostgresNode->new('primary'); $node_primary->init( has_archiving => 1, allows_streaming => 1); @@ -23,7 +23,7 @@ $node_primary->start; $node_primary->backup($backup_name); # Initialize standby node from backup, fetching WAL from archives -my $node_standby = get_new_node('standby'); +my $node_standby = PostgresNode->new('standby'); $node_standby->init_from_backup($node_primary, $backup_name, has_restoring => 1); $node_standby->append_conf('postgresql.conf', @@ -62,7 +62,7 @@ is($result, qq(1000), 'check content from archives'); # promoted. $node_standby->promote; -my $node_standby2 = get_new_node('standby2'); +my $node_standby2 = PostgresNode->new('standby2'); $node_standby2->init_from_backup($node_primary, $backup_name, has_restoring => 1); $node_standby2->start; diff --git a/src/test/recovery/t/003_recovery_targets.pl b/src/test/recovery/t/003_recovery_targets.pl index 84e977bd6d9..7bd500ed956 100644 --- a/src/test/recovery/t/003_recovery_targets.pl +++ b/src/test/recovery/t/003_recovery_targets.pl @@ -21,7 +21,7 @@ sub test_recovery_standby my $num_rows = shift; my $until_lsn = shift; - my $node_standby = get_new_node($node_name); + my $node_standby = PostgresNode->new($node_name); $node_standby->init_from_backup($node_primary, 'my_backup', has_restoring => 1); @@ -50,7 +50,7 @@ sub test_recovery_standby } # Initialize primary node -my $node_primary = get_new_node('primary'); +my $node_primary = PostgresNode->new('primary'); $node_primary->init(has_archiving => 1, allows_streaming => 1); # Bump the transaction ID epoch. This is useful to stress the portability @@ -136,7 +136,7 @@ test_recovery_standby('LSN', 'standby_5', $node_primary, \@recovery_params, test_recovery_standby('multiple overriding settings', 'standby_6', $node_primary, \@recovery_params, "3000", $lsn3); -my $node_standby = get_new_node('standby_7'); +my $node_standby = PostgresNode->new('standby_7'); $node_standby->init_from_backup($node_primary, 'my_backup', has_restoring => 1); $node_standby->append_conf( @@ -156,7 +156,7 @@ ok($logfile =~ qr/multiple recovery targets specified/, # Check behavior when recovery ends before target is reached -$node_standby = get_new_node('standby_8'); +$node_standby = PostgresNode->new('standby_8'); $node_standby->init_from_backup( $node_primary, 'my_backup', has_restoring => 1, diff --git a/src/test/recovery/t/004_timeline_switch.pl b/src/test/recovery/t/004_timeline_switch.pl index c101980e9e2..07b15270438 100644 --- a/src/test/recovery/t/004_timeline_switch.pl +++ b/src/test/recovery/t/004_timeline_switch.pl @@ -15,7 +15,7 @@ $ENV{PGDATABASE} = 'postgres'; # on a new timeline. # Initialize primary node -my $node_primary = get_new_node('primary'); +my $node_primary = PostgresNode->new('primary'); $node_primary->init(allows_streaming => 1); $node_primary->start; @@ -24,11 +24,11 @@ my $backup_name = 'my_backup'; $node_primary->backup($backup_name); # Create two standbys linking to it -my $node_standby_1 = get_new_node('standby_1'); +my $node_standby_1 = PostgresNode->new('standby_1'); $node_standby_1->init_from_backup($node_primary, $backup_name, has_streaming => 1); $node_standby_1->start; -my $node_standby_2 = get_new_node('standby_2'); +my $node_standby_2 = PostgresNode->new('standby_2'); $node_standby_2->init_from_backup($node_primary, $backup_name, has_streaming => 1); $node_standby_2->start; @@ -76,7 +76,7 @@ is($result, qq(2000), 'check content of standby 2'); # when WAL archiving is enabled. # Initialize primary node -my $node_primary_2 = get_new_node('primary_2'); +my $node_primary_2 = PostgresNode->new('primary_2'); $node_primary_2->init(allows_streaming => 1, has_archiving => 1); $node_primary_2->append_conf( 'postgresql.conf', qq( @@ -88,7 +88,7 @@ $node_primary_2->start; $node_primary_2->backup($backup_name); # Create standby node -my $node_standby_3 = get_new_node('standby_3'); +my $node_standby_3 = PostgresNode->new('standby_3'); $node_standby_3->init_from_backup($node_primary_2, $backup_name, has_streaming => 1); diff --git a/src/test/recovery/t/005_replay_delay.pl b/src/test/recovery/t/005_replay_delay.pl index bd7ed4e3044..0b56380e0a7 100644 --- a/src/test/recovery/t/005_replay_delay.pl +++ b/src/test/recovery/t/005_replay_delay.pl @@ -10,7 +10,7 @@ use TestLib; use Test::More tests => 3; # Initialize primary node -my $node_primary = get_new_node('primary'); +my $node_primary = PostgresNode->new('primary'); $node_primary->init(allows_streaming => 1); $node_primary->start; @@ -23,7 +23,7 @@ my $backup_name = 'my_backup'; $node_primary->backup($backup_name); # Create streaming standby from backup -my $node_standby = get_new_node('standby'); +my $node_standby = PostgresNode->new('standby'); my $delay = 3; $node_standby->init_from_backup($node_primary, $backup_name, has_streaming => 1); @@ -58,7 +58,7 @@ ok(time() - $primary_insert_time >= $delay, # Check that recovery can be paused or resumed expectedly. -my $node_standby2 = get_new_node('standby2'); +my $node_standby2 = PostgresNode->new('standby2'); $node_standby2->init_from_backup($node_primary, $backup_name, has_streaming => 1); $node_standby2->start; diff --git a/src/test/recovery/t/006_logical_decoding.pl b/src/test/recovery/t/006_logical_decoding.pl index 827a7b488e2..cc116062c2c 100644 --- a/src/test/recovery/t/006_logical_decoding.pl +++ b/src/test/recovery/t/006_logical_decoding.pl @@ -14,7 +14,7 @@ use Test::More tests => 14; use Config; # Initialize primary node -my $node_primary = get_new_node('primary'); +my $node_primary = PostgresNode->new('primary'); $node_primary->init(allows_streaming => 1); $node_primary->append_conf( 'postgresql.conf', qq( diff --git a/src/test/recovery/t/007_sync_rep.pl b/src/test/recovery/t/007_sync_rep.pl index 81098dcf00c..9d00e17f9f0 100644 --- a/src/test/recovery/t/007_sync_rep.pl +++ b/src/test/recovery/t/007_sync_rep.pl @@ -49,7 +49,7 @@ sub start_standby_and_wait } # Initialize primary node -my $node_primary = get_new_node('primary'); +my $node_primary = PostgresNode->new('primary'); $node_primary->init(allows_streaming => 1); $node_primary->start; my $backup_name = 'primary_backup'; @@ -61,19 +61,19 @@ $node_primary->backup($backup_name); # the ordering of each one of them in the WAL sender array of the primary. # Create standby1 linking to primary -my $node_standby_1 = get_new_node('standby1'); +my $node_standby_1 = PostgresNode->new('standby1'); $node_standby_1->init_from_backup($node_primary, $backup_name, has_streaming => 1); start_standby_and_wait($node_primary, $node_standby_1); # Create standby2 linking to primary -my $node_standby_2 = get_new_node('standby2'); +my $node_standby_2 = PostgresNode->new('standby2'); $node_standby_2->init_from_backup($node_primary, $backup_name, has_streaming => 1); start_standby_and_wait($node_primary, $node_standby_2); # Create standby3 linking to primary -my $node_standby_3 = get_new_node('standby3'); +my $node_standby_3 = PostgresNode->new('standby3'); $node_standby_3->init_from_backup($node_primary, $backup_name, has_streaming => 1); start_standby_and_wait($node_primary, $node_standby_3); @@ -123,7 +123,7 @@ standby3|3|sync), start_standby_and_wait($node_primary, $node_standby_1); # Create standby4 linking to primary -my $node_standby_4 = get_new_node('standby4'); +my $node_standby_4 = PostgresNode->new('standby4'); $node_standby_4->init_from_backup($node_primary, $backup_name, has_streaming => 1); $node_standby_4->start; diff --git a/src/test/recovery/t/008_fsm_truncation.pl b/src/test/recovery/t/008_fsm_truncation.pl index 14b4b97e9e7..b1082546a81 100644 --- a/src/test/recovery/t/008_fsm_truncation.pl +++ b/src/test/recovery/t/008_fsm_truncation.pl @@ -12,7 +12,7 @@ use PostgresNode; use TestLib; use Test::More tests => 1; -my $node_primary = get_new_node('primary'); +my $node_primary = PostgresNode->new('primary'); $node_primary->init(allows_streaming => 1); $node_primary->append_conf( @@ -28,7 +28,7 @@ autovacuum = off $node_primary->start; $node_primary->backup('primary_backup'); -my $node_standby = get_new_node('standby'); +my $node_standby = PostgresNode->new('standby'); $node_standby->init_from_backup($node_primary, 'primary_backup', has_streaming => 1); $node_standby->start; diff --git a/src/test/recovery/t/009_twophase.pl b/src/test/recovery/t/009_twophase.pl index 3ee012226da..78d4ef5b54b 100644 --- a/src/test/recovery/t/009_twophase.pl +++ b/src/test/recovery/t/009_twophase.pl @@ -29,7 +29,7 @@ sub configure_and_reload # Set up two nodes, which will alternately be primary and replication standby. # Setup london node -my $node_london = get_new_node("london"); +my $node_london = PostgresNode->new("london"); $node_london->init(allows_streaming => 1); $node_london->append_conf( 'postgresql.conf', qq( @@ -40,7 +40,7 @@ $node_london->start; $node_london->backup('london_backup'); # Setup paris node -my $node_paris = get_new_node('paris'); +my $node_paris = PostgresNode->new('paris'); $node_paris->init_from_backup($node_london, 'london_backup', has_streaming => 1); $node_paris->start; diff --git a/src/test/recovery/t/010_logical_decoding_timelines.pl b/src/test/recovery/t/010_logical_decoding_timelines.pl index 12edbf760e1..2a9cf3b79c3 100644 --- a/src/test/recovery/t/010_logical_decoding_timelines.pl +++ b/src/test/recovery/t/010_logical_decoding_timelines.pl @@ -34,7 +34,7 @@ use Scalar::Util qw(blessed); my ($stdout, $stderr, $ret); # Initialize primary node -my $node_primary = get_new_node('primary'); +my $node_primary = PostgresNode->new('primary'); $node_primary->init(allows_streaming => 1, has_archiving => 1); $node_primary->append_conf( 'postgresql.conf', q[ @@ -74,7 +74,7 @@ $node_primary->backup_fs_hot($backup_name); $node_primary->safe_psql('postgres', q[SELECT pg_create_physical_replication_slot('phys_slot');]); -my $node_replica = get_new_node('replica'); +my $node_replica = PostgresNode->new('replica'); $node_replica->init_from_backup( $node_primary, $backup_name, has_streaming => 1, diff --git a/src/test/recovery/t/011_crash_recovery.pl b/src/test/recovery/t/011_crash_recovery.pl index a26e99500b2..72fc603e6d2 100644 --- a/src/test/recovery/t/011_crash_recovery.pl +++ b/src/test/recovery/t/011_crash_recovery.pl @@ -13,7 +13,7 @@ use Config; plan tests => 3; -my $node = get_new_node('primary'); +my $node = PostgresNode->new('primary'); $node->init(allows_streaming => 1); $node->start; diff --git a/src/test/recovery/t/012_subtransactions.pl b/src/test/recovery/t/012_subtransactions.pl index aa84073311b..a3655a076b8 100644 --- a/src/test/recovery/t/012_subtransactions.pl +++ b/src/test/recovery/t/012_subtransactions.pl @@ -10,7 +10,7 @@ use TestLib; use Test::More tests => 12; # Setup primary node -my $node_primary = get_new_node("primary"); +my $node_primary = PostgresNode->new("primary"); $node_primary->init(allows_streaming => 1); $node_primary->append_conf( 'postgresql.conf', qq( @@ -22,7 +22,7 @@ $node_primary->backup('primary_backup'); $node_primary->psql('postgres', "CREATE TABLE t_012_tbl (id int)"); # Setup standby node -my $node_standby = get_new_node('standby'); +my $node_standby = PostgresNode->new('standby'); $node_standby->init_from_backup($node_primary, 'primary_backup', has_streaming => 1); $node_standby->start; diff --git a/src/test/recovery/t/013_crash_restart.pl b/src/test/recovery/t/013_crash_restart.pl index 868a50b33d3..b5e3457753f 100644 --- a/src/test/recovery/t/013_crash_restart.pl +++ b/src/test/recovery/t/013_crash_restart.pl @@ -27,7 +27,7 @@ plan tests => 18; # is really wrong. my $psql_timeout = IPC::Run::timer(60); -my $node = get_new_node('primary'); +my $node = PostgresNode->new('primary'); $node->init(allows_streaming => 1); $node->start(); diff --git a/src/test/recovery/t/014_unlogged_reinit.pl b/src/test/recovery/t/014_unlogged_reinit.pl index b629d549dd9..4c22663b644 100644 --- a/src/test/recovery/t/014_unlogged_reinit.pl +++ b/src/test/recovery/t/014_unlogged_reinit.pl @@ -12,7 +12,7 @@ use PostgresNode; use TestLib; use Test::More tests => 12; -my $node = get_new_node('main'); +my $node = PostgresNode->new('main'); $node->init; $node->start; diff --git a/src/test/recovery/t/015_promotion_pages.pl b/src/test/recovery/t/015_promotion_pages.pl index 2b72dc23343..562c4cd3e4f 100644 --- a/src/test/recovery/t/015_promotion_pages.pl +++ b/src/test/recovery/t/015_promotion_pages.pl @@ -12,7 +12,7 @@ use TestLib; use Test::More tests => 1; # Initialize primary node -my $alpha = get_new_node('alpha'); +my $alpha = PostgresNode->new('alpha'); $alpha->init(allows_streaming => 1); # Setting wal_log_hints to off is important to get invalid page # references. @@ -25,7 +25,7 @@ $alpha->start; # setup/start a standby $alpha->backup('bkp'); -my $bravo = get_new_node('bravo'); +my $bravo = PostgresNode->new('bravo'); $bravo->init_from_backup($alpha, 'bkp', has_streaming => 1); $bravo->append_conf('postgresql.conf', <<EOF); checkpoint_timeout=1h diff --git a/src/test/recovery/t/016_min_consistency.pl b/src/test/recovery/t/016_min_consistency.pl index 60ecd3dbe7c..23f4c427453 100644 --- a/src/test/recovery/t/016_min_consistency.pl +++ b/src/test/recovery/t/016_min_consistency.pl @@ -43,7 +43,7 @@ sub find_largest_lsn } # Initialize primary node -my $primary = get_new_node('primary'); +my $primary = PostgresNode->new('primary'); $primary->init(allows_streaming => 1); # Set shared_buffers to a very low value to enforce discard and flush @@ -61,7 +61,7 @@ $primary->start; # setup/start a standby $primary->backup('bkp'); -my $standby = get_new_node('standby'); +my $standby = PostgresNode->new('standby'); $standby->init_from_backup($primary, 'bkp', has_streaming => 1); $standby->start; diff --git a/src/test/recovery/t/017_shm.pl b/src/test/recovery/t/017_shm.pl index 6fe9b97f6e0..5548a1556d3 100644 --- a/src/test/recovery/t/017_shm.pl +++ b/src/test/recovery/t/017_shm.pl @@ -43,7 +43,7 @@ sub log_ipcs } # Node setup. -my $gnat = PostgresNode->get_new_node('gnat'); +my $gnat = PostgresNode->new('gnat'); $gnat->init; # Create a shmem segment that will conflict with gnat's first choice diff --git a/src/test/recovery/t/018_wal_optimize.pl b/src/test/recovery/t/018_wal_optimize.pl index 53d9864309f..4aa1bf8f545 100644 --- a/src/test/recovery/t/018_wal_optimize.pl +++ b/src/test/recovery/t/018_wal_optimize.pl @@ -43,7 +43,7 @@ sub run_wal_optimize { my $wal_level = shift; - my $node = get_new_node("node_$wal_level"); + my $node = PostgresNode->new("node_$wal_level"); $node->init; $node->append_conf( 'postgresql.conf', qq( diff --git a/src/test/recovery/t/019_replslot_limit.pl b/src/test/recovery/t/019_replslot_limit.pl index 54ddcef2bbd..99e1a83e4b5 100644 --- a/src/test/recovery/t/019_replslot_limit.pl +++ b/src/test/recovery/t/019_replslot_limit.pl @@ -17,7 +17,7 @@ use Time::HiRes qw(usleep); $ENV{PGDATABASE} = 'postgres'; # Initialize primary node, setting wal-segsize to 1MB -my $node_primary = get_new_node('primary'); +my $node_primary = PostgresNode->new('primary'); $node_primary->init(allows_streaming => 1, extra => ['--wal-segsize=1']); $node_primary->append_conf( 'postgresql.conf', qq( @@ -41,7 +41,7 @@ my $backup_name = 'my_backup'; $node_primary->backup($backup_name); # Create a standby linking to it using the replication slot -my $node_standby = get_new_node('standby_1'); +my $node_standby = PostgresNode->new('standby_1'); $node_standby->init_from_backup($node_primary, $backup_name, has_streaming => 1); $node_standby->append_conf('postgresql.conf', "primary_slot_name = 'rep1'"); @@ -250,7 +250,7 @@ ok($failed, 'check that replication has been broken'); $node_primary->stop; $node_standby->stop; -my $node_primary2 = get_new_node('primary2'); +my $node_primary2 = PostgresNode->new('primary2'); $node_primary2->init(allows_streaming => 1); $node_primary2->append_conf( 'postgresql.conf', qq( @@ -271,7 +271,7 @@ max_slot_wal_keep_size = 0 )); $node_primary2->start; -$node_standby = get_new_node('standby_2'); +$node_standby = PostgresNode->new('standby_2'); $node_standby->init_from_backup($node_primary2, $backup_name, has_streaming => 1); $node_standby->append_conf('postgresql.conf', "primary_slot_name = 'rep1'"); @@ -303,7 +303,7 @@ if ($TestLib::windows_os) # Get a slot terminated while the walsender is active # We do this by sending SIGSTOP to the walsender. Skip this on Windows. -my $node_primary3 = get_new_node('primary3'); +my $node_primary3 = PostgresNode->new('primary3'); $node_primary3->init(allows_streaming => 1, extra => ['--wal-segsize=1']); $node_primary3->append_conf( 'postgresql.conf', qq( @@ -319,7 +319,7 @@ $node_primary3->safe_psql('postgres', $backup_name = 'my_backup'; $node_primary3->backup($backup_name); # Create standby -my $node_standby3 = get_new_node('standby_3'); +my $node_standby3 = PostgresNode->new('standby_3'); $node_standby3->init_from_backup($node_primary3, $backup_name, has_streaming => 1); $node_standby3->append_conf('postgresql.conf', "primary_slot_name = 'rep3'"); diff --git a/src/test/recovery/t/020_archive_status.pl b/src/test/recovery/t/020_archive_status.pl index 777bf052743..cea65735a39 100644 --- a/src/test/recovery/t/020_archive_status.pl +++ b/src/test/recovery/t/020_archive_status.pl @@ -11,7 +11,7 @@ use TestLib; use Test::More tests => 16; use Config; -my $primary = get_new_node('primary'); +my $primary = PostgresNode->new('primary'); $primary->init( has_archiving => 1, allows_streaming => 1); @@ -138,7 +138,7 @@ $primary->poll_query_until('postgres', or die "Timed out while waiting for archiving to finish"; # Test standby with archive_mode = on. -my $standby1 = get_new_node('standby'); +my $standby1 = PostgresNode->new('standby'); $standby1->init_from_backup($primary, 'backup', has_restoring => 1); $standby1->append_conf('postgresql.conf', "archive_mode = on"); my $standby1_data = $standby1->data_dir; @@ -174,7 +174,7 @@ ok( -f "$standby1_data/$segment_path_2_done", # command to fail to persist the .ready files. Note that this node # has inherited the archive command of the previous cold backup that # will cause archiving failures. -my $standby2 = get_new_node('standby2'); +my $standby2 = PostgresNode->new('standby2'); $standby2->init_from_backup($primary, 'backup', has_restoring => 1); $standby2->append_conf('postgresql.conf', 'archive_mode = always'); my $standby2_data = $standby2->data_dir; diff --git a/src/test/recovery/t/021_row_visibility.pl b/src/test/recovery/t/021_row_visibility.pl index fcff0a2feba..7f40977976b 100644 --- a/src/test/recovery/t/021_row_visibility.pl +++ b/src/test/recovery/t/021_row_visibility.pl @@ -12,7 +12,7 @@ use Test::More tests => 10; use Config; # Initialize primary node -my $node_primary = get_new_node('primary'); +my $node_primary = PostgresNode->new('primary'); $node_primary->init(allows_streaming => 1); $node_primary->append_conf('postgresql.conf', 'max_prepared_transactions=10'); $node_primary->start; @@ -26,7 +26,7 @@ my $backup_name = 'my_backup'; $node_primary->backup($backup_name); # Create streaming standby from backup -my $node_standby = get_new_node('standby'); +my $node_standby = PostgresNode->new('standby'); $node_standby->init_from_backup($node_primary, $backup_name, has_streaming => 1); $node_standby->append_conf('postgresql.conf', 'max_prepared_transactions=10'); diff --git a/src/test/recovery/t/022_crash_temp_files.pl b/src/test/recovery/t/022_crash_temp_files.pl index 157ddba8cfa..cc8c8664e28 100644 --- a/src/test/recovery/t/022_crash_temp_files.pl +++ b/src/test/recovery/t/022_crash_temp_files.pl @@ -26,7 +26,7 @@ else # is really wrong. my $psql_timeout = IPC::Run::timer(60); -my $node = get_new_node('node_crash'); +my $node = PostgresNode->new('node_crash'); $node->init(); $node->start(); diff --git a/src/test/recovery/t/023_pitr_prepared_xact.pl b/src/test/recovery/t/023_pitr_prepared_xact.pl index 9190a38f93c..a1ff97d070a 100644 --- a/src/test/recovery/t/023_pitr_prepared_xact.pl +++ b/src/test/recovery/t/023_pitr_prepared_xact.pl @@ -10,7 +10,7 @@ use Test::More tests => 1; use File::Compare; # Initialize and start primary node with WAL archiving -my $node_primary = get_new_node('primary'); +my $node_primary = PostgresNode->new('primary'); $node_primary->init(has_archiving => 1, allows_streaming => 1); $node_primary->append_conf( 'postgresql.conf', qq{ @@ -24,7 +24,7 @@ $node_primary->backup($backup_name); # Initialize node for PITR targeting a very specific restore point, just # after a PREPARE TRANSACTION is issued so as we finish with a promoted # node where this 2PC transaction needs an explicit COMMIT PREPARED. -my $node_pitr = get_new_node('node_pitr'); +my $node_pitr = PostgresNode->new('node_pitr'); $node_pitr->init_from_backup( $node_primary, $backup_name, standby => 0, diff --git a/src/test/recovery/t/024_archive_recovery.pl b/src/test/recovery/t/024_archive_recovery.pl index f06ed8c8a13..32be5c42515 100644 --- a/src/test/recovery/t/024_archive_recovery.pl +++ b/src/test/recovery/t/024_archive_recovery.pl @@ -11,7 +11,7 @@ use Time::HiRes qw(usleep); # Initialize and start node with wal_level = replica and WAL archiving # enabled. -my $node = get_new_node('orig'); +my $node = PostgresNode->new('orig'); $node->init(has_archiving => 1, allows_streaming => 1); my $replica_config = q[ wal_level = replica @@ -66,7 +66,7 @@ sub test_recovery_wal_level_minimal { my ($node_name, $node_text, $standby_setting) = @_; - my $recovery_node = get_new_node($node_name); + my $recovery_node = PostgresNode->new($node_name); $recovery_node->init_from_backup( $node, $backup_name, has_restoring => 1, diff --git a/src/test/recovery/t/025_stuck_on_old_timeline.pl b/src/test/recovery/t/025_stuck_on_old_timeline.pl index fb15f9576be..00ee9fcaedd 100644 --- a/src/test/recovery/t/025_stuck_on_old_timeline.pl +++ b/src/test/recovery/t/025_stuck_on_old_timeline.pl @@ -16,7 +16,7 @@ use FindBin; use Test::More tests => 1; # Initialize primary node -my $node_primary = get_new_node('primary'); +my $node_primary = PostgresNode->new('primary'); # Set up an archive command that will copy the history file but not the WAL # files. No real archive command should behave this way; the point is to @@ -47,7 +47,7 @@ my $backup_name = 'my_backup'; $node_primary->backup($backup_name); # Create streaming standby linking to primary -my $node_standby = get_new_node('standby'); +my $node_standby = PostgresNode->new('standby'); $node_standby->init_from_backup( $node_primary, $backup_name, allows_streaming => 1, @@ -60,7 +60,7 @@ $node_standby->backup($backup_name, backup_options => ['-Xnone']); # Create cascading standby but don't start it yet. # Must set up both streaming and archiving. -my $node_cascade = get_new_node('cascade'); +my $node_cascade = PostgresNode->new('cascade'); $node_cascade->init_from_backup($node_standby, $backup_name, has_streaming => 1); $node_cascade->enable_restoring($node_primary); diff --git a/src/test/ssl/t/001_ssltests.pl b/src/test/ssl/t/001_ssltests.pl index 44daefb0021..3bc711f4a77 100644 --- a/src/test/ssl/t/001_ssltests.pl +++ b/src/test/ssl/t/001_ssltests.pl @@ -64,7 +64,7 @@ push @keys, 'client_wrongperms'; #### Set up the server. note "setting up data directory"; -my $node = get_new_node('primary'); +my $node = PostgresNode->new('primary'); $node->init; # PGHOST is enforced here to set up the node, subsequent connections diff --git a/src/test/ssl/t/002_scram.pl b/src/test/ssl/t/002_scram.pl index 9143fa515f2..1dfa2b91f32 100644 --- a/src/test/ssl/t/002_scram.pl +++ b/src/test/ssl/t/002_scram.pl @@ -38,7 +38,7 @@ my $common_connstr; # Set up the server. note "setting up data directory"; -my $node = get_new_node('primary'); +my $node = PostgresNode->new('primary'); $node->init; # PGHOST is enforced here to set up the node, subsequent connections diff --git a/src/test/subscription/t/001_rep_changes.pl b/src/test/subscription/t/001_rep_changes.pl index dee5f5c30ad..0c84d87873c 100644 --- a/src/test/subscription/t/001_rep_changes.pl +++ b/src/test/subscription/t/001_rep_changes.pl @@ -9,12 +9,12 @@ use TestLib; use Test::More tests => 32; # Initialize publisher node -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->start; # Create subscriber node -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->start; diff --git a/src/test/subscription/t/002_types.pl b/src/test/subscription/t/002_types.pl index 96669f869b1..420876099ad 100644 --- a/src/test/subscription/t/002_types.pl +++ b/src/test/subscription/t/002_types.pl @@ -10,12 +10,12 @@ use TestLib; use Test::More tests => 4; # Initialize publisher node -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->start; # Create subscriber node -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->start; diff --git a/src/test/subscription/t/003_constraints.pl b/src/test/subscription/t/003_constraints.pl index 1182a1288ce..3767d24f92b 100644 --- a/src/test/subscription/t/003_constraints.pl +++ b/src/test/subscription/t/003_constraints.pl @@ -9,12 +9,12 @@ use TestLib; use Test::More tests => 6; # Initialize publisher node -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->start; # Create subscriber node -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->start; diff --git a/src/test/subscription/t/004_sync.pl b/src/test/subscription/t/004_sync.pl index b3c91af21d1..f07c306e5b7 100644 --- a/src/test/subscription/t/004_sync.pl +++ b/src/test/subscription/t/004_sync.pl @@ -9,12 +9,12 @@ use TestLib; use Test::More tests => 8; # Initialize publisher node -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->start; # Create subscriber node -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->append_conf('postgresql.conf', "wal_retrieve_retry_interval = 1ms"); diff --git a/src/test/subscription/t/005_encoding.pl b/src/test/subscription/t/005_encoding.pl index a3f56a452f3..9df474beb5a 100644 --- a/src/test/subscription/t/005_encoding.pl +++ b/src/test/subscription/t/005_encoding.pl @@ -8,13 +8,13 @@ use PostgresNode; use TestLib; use Test::More tests => 1; -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init( allows_streaming => 'logical', extra => [ '--locale=C', '--encoding=UTF8' ]); $node_publisher->start; -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init( allows_streaming => 'logical', extra => [ '--locale=C', '--encoding=LATIN1' ]); diff --git a/src/test/subscription/t/006_rewrite.pl b/src/test/subscription/t/006_rewrite.pl index 37e05a401af..ec4d641230b 100644 --- a/src/test/subscription/t/006_rewrite.pl +++ b/src/test/subscription/t/006_rewrite.pl @@ -8,11 +8,11 @@ use PostgresNode; use TestLib; use Test::More tests => 2; -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->start; -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->start; diff --git a/src/test/subscription/t/007_ddl.pl b/src/test/subscription/t/007_ddl.pl index dd10d5cffa8..1a3a1dcf14d 100644 --- a/src/test/subscription/t/007_ddl.pl +++ b/src/test/subscription/t/007_ddl.pl @@ -8,11 +8,11 @@ use PostgresNode; use TestLib; use Test::More tests => 1; -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->start; -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->start; diff --git a/src/test/subscription/t/008_diff_schema.pl b/src/test/subscription/t/008_diff_schema.pl index a04a798a187..3af3d25604e 100644 --- a/src/test/subscription/t/008_diff_schema.pl +++ b/src/test/subscription/t/008_diff_schema.pl @@ -9,12 +9,12 @@ use TestLib; use Test::More tests => 5; # Create publisher node -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->start; # Create subscriber node -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->start; diff --git a/src/test/subscription/t/009_matviews.pl b/src/test/subscription/t/009_matviews.pl index 92c7d18be8e..2e7d0d44138 100644 --- a/src/test/subscription/t/009_matviews.pl +++ b/src/test/subscription/t/009_matviews.pl @@ -8,11 +8,11 @@ use PostgresNode; use TestLib; use Test::More tests => 1; -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->start; -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->start; diff --git a/src/test/subscription/t/010_truncate.pl b/src/test/subscription/t/010_truncate.pl index 5617469a2c3..0e6ecf9c2fc 100644 --- a/src/test/subscription/t/010_truncate.pl +++ b/src/test/subscription/t/010_truncate.pl @@ -10,11 +10,11 @@ use Test::More tests => 14; # setup -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->start; -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->append_conf('postgresql.conf', qq(max_logical_replication_workers = 6)); diff --git a/src/test/subscription/t/011_generated.pl b/src/test/subscription/t/011_generated.pl index 29108cbcf20..a8e7fbd9dab 100644 --- a/src/test/subscription/t/011_generated.pl +++ b/src/test/subscription/t/011_generated.pl @@ -10,11 +10,11 @@ use Test::More tests => 2; # setup -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->start; -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->start; diff --git a/src/test/subscription/t/012_collation.pl b/src/test/subscription/t/012_collation.pl index 8137a165eed..09873911886 100644 --- a/src/test/subscription/t/012_collation.pl +++ b/src/test/subscription/t/012_collation.pl @@ -18,13 +18,13 @@ else plan skip_all => 'ICU not supported by this build'; } -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init( allows_streaming => 'logical', extra => [ '--locale=C', '--encoding=UTF8' ]); $node_publisher->start; -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init( allows_streaming => 'logical', extra => [ '--locale=C', '--encoding=UTF8' ]); diff --git a/src/test/subscription/t/013_partition.pl b/src/test/subscription/t/013_partition.pl index 3478e4db8fd..c89d4952219 100644 --- a/src/test/subscription/t/013_partition.pl +++ b/src/test/subscription/t/013_partition.pl @@ -10,15 +10,15 @@ use Test::More tests => 62; # setup -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->start; -my $node_subscriber1 = get_new_node('subscriber1'); +my $node_subscriber1 = PostgresNode->new('subscriber1'); $node_subscriber1->init(allows_streaming => 'logical'); $node_subscriber1->start; -my $node_subscriber2 = get_new_node('subscriber2'); +my $node_subscriber2 = PostgresNode->new('subscriber2'); $node_subscriber2->init(allows_streaming => 'logical'); $node_subscriber2->start; diff --git a/src/test/subscription/t/014_binary.pl b/src/test/subscription/t/014_binary.pl index 7260378f5e8..4e8aeb2e413 100644 --- a/src/test/subscription/t/014_binary.pl +++ b/src/test/subscription/t/014_binary.pl @@ -10,12 +10,12 @@ use TestLib; use Test::More tests => 5; # Create and initialize a publisher node -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->start; # Create and initialize subscriber node -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->start; diff --git a/src/test/subscription/t/015_stream.pl b/src/test/subscription/t/015_stream.pl index 6cc8b4a8d26..da6761f81ea 100644 --- a/src/test/subscription/t/015_stream.pl +++ b/src/test/subscription/t/015_stream.pl @@ -9,14 +9,14 @@ use TestLib; use Test::More tests => 4; # Create publisher node -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->append_conf('postgresql.conf', 'logical_decoding_work_mem = 64kB'); $node_publisher->start; # Create subscriber node -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->start; diff --git a/src/test/subscription/t/016_stream_subxact.pl b/src/test/subscription/t/016_stream_subxact.pl index 0245b0685b1..4aae98a66ec 100644 --- a/src/test/subscription/t/016_stream_subxact.pl +++ b/src/test/subscription/t/016_stream_subxact.pl @@ -9,14 +9,14 @@ use TestLib; use Test::More tests => 2; # Create publisher node -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->append_conf('postgresql.conf', 'logical_decoding_work_mem = 64kB'); $node_publisher->start; # Create subscriber node -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->start; diff --git a/src/test/subscription/t/017_stream_ddl.pl b/src/test/subscription/t/017_stream_ddl.pl index 35b146827d3..50bd6e31173 100644 --- a/src/test/subscription/t/017_stream_ddl.pl +++ b/src/test/subscription/t/017_stream_ddl.pl @@ -9,14 +9,14 @@ use TestLib; use Test::More tests => 3; # Create publisher node -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->append_conf('postgresql.conf', 'logical_decoding_work_mem = 64kB'); $node_publisher->start; # Create subscriber node -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->start; diff --git a/src/test/subscription/t/018_stream_subxact_abort.pl b/src/test/subscription/t/018_stream_subxact_abort.pl index 7fc60b5bde8..63fe248a047 100644 --- a/src/test/subscription/t/018_stream_subxact_abort.pl +++ b/src/test/subscription/t/018_stream_subxact_abort.pl @@ -9,14 +9,14 @@ use TestLib; use Test::More tests => 4; # Create publisher node -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->append_conf('postgresql.conf', 'logical_decoding_work_mem = 64kB'); $node_publisher->start; # Create subscriber node -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->start; diff --git a/src/test/subscription/t/019_stream_subxact_ddl_abort.pl b/src/test/subscription/t/019_stream_subxact_ddl_abort.pl index 81149b86a99..176a7024861 100644 --- a/src/test/subscription/t/019_stream_subxact_ddl_abort.pl +++ b/src/test/subscription/t/019_stream_subxact_ddl_abort.pl @@ -10,14 +10,14 @@ use TestLib; use Test::More tests => 2; # Create publisher node -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->append_conf('postgresql.conf', 'logical_decoding_work_mem = 64kB'); $node_publisher->start; # Create subscriber node -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->start; diff --git a/src/test/subscription/t/020_messages.pl b/src/test/subscription/t/020_messages.pl index 0e218e0048b..ecf9b192a34 100644 --- a/src/test/subscription/t/020_messages.pl +++ b/src/test/subscription/t/020_messages.pl @@ -9,13 +9,13 @@ use TestLib; use Test::More tests => 5; # Create publisher node -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->append_conf('postgresql.conf', 'autovacuum = off'); $node_publisher->start; # Create subscriber node -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->start; diff --git a/src/test/subscription/t/021_twophase.pl b/src/test/subscription/t/021_twophase.pl index c6ada92ff0a..903a771fe35 100644 --- a/src/test/subscription/t/021_twophase.pl +++ b/src/test/subscription/t/021_twophase.pl @@ -13,14 +13,14 @@ use Test::More tests => 24; ############################### # Initialize publisher node -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->append_conf('postgresql.conf', qq(max_prepared_transactions = 10)); $node_publisher->start; # Create subscriber node -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->append_conf('postgresql.conf', qq(max_prepared_transactions = 10)); diff --git a/src/test/subscription/t/022_twophase_cascade.pl b/src/test/subscription/t/022_twophase_cascade.pl index e61d28a48b1..d7cc99959f8 100644 --- a/src/test/subscription/t/022_twophase_cascade.pl +++ b/src/test/subscription/t/022_twophase_cascade.pl @@ -15,19 +15,19 @@ use Test::More tests => 27; # Initialize nodes # node_A -my $node_A = get_new_node('node_A'); +my $node_A = PostgresNode->new('node_A'); $node_A->init(allows_streaming => 'logical'); $node_A->append_conf('postgresql.conf', qq(max_prepared_transactions = 10)); $node_A->start; # node_B -my $node_B = get_new_node('node_B'); +my $node_B = PostgresNode->new('node_B'); $node_B->init(allows_streaming => 'logical'); $node_B->append_conf('postgresql.conf', qq(max_prepared_transactions = 10)); $node_B->start; # node_C -my $node_C = get_new_node('node_C'); +my $node_C = PostgresNode->new('node_C'); $node_C->init(allows_streaming => 'logical'); $node_C->append_conf('postgresql.conf', qq(max_prepared_transactions = 10)); diff --git a/src/test/subscription/t/100_bugs.pl b/src/test/subscription/t/100_bugs.pl index 21eabceb2f6..baa4a907713 100644 --- a/src/test/subscription/t/100_bugs.pl +++ b/src/test/subscription/t/100_bugs.pl @@ -19,11 +19,11 @@ use Test::More tests => 5; # fix was to avoid the constant expressions simplification in # RelationGetIndexAttrBitmap(), so it's safe to call in more contexts. -my $node_publisher = get_new_node('publisher'); +my $node_publisher = PostgresNode->new('publisher'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->start; -my $node_subscriber = get_new_node('subscriber'); +my $node_subscriber = PostgresNode->new('subscriber'); $node_subscriber->init(allows_streaming => 'logical'); $node_subscriber->start; @@ -81,7 +81,7 @@ $node_subscriber->stop('fast'); # identity set before accepting updates. If it did not it would cause # an error when an update was attempted. -$node_publisher = get_new_node('publisher2'); +$node_publisher = PostgresNode->new('publisher2'); $node_publisher->init(allows_streaming => 'logical'); $node_publisher->start; @@ -108,7 +108,7 @@ $node_publisher->stop('fast'); # # Initial sync doesn't complete; the protocol was not being followed per # expectations after commit 07082b08cc5d. -my $node_twoways = get_new_node('twoways'); +my $node_twoways = PostgresNode->new('twoways'); $node_twoways->init(allows_streaming => 'logical'); $node_twoways->start; for my $db (qw(d1 d2)) @@ -158,15 +158,15 @@ is($node_twoways->safe_psql('d2', "SELECT count(f) FROM t2"), # Verify table data is synced with cascaded replication setup. This is mainly # to test whether the data written by tablesync worker gets replicated. -my $node_pub = get_new_node('testpublisher1'); +my $node_pub = PostgresNode->new('testpublisher1'); $node_pub->init(allows_streaming => 'logical'); $node_pub->start; -my $node_pub_sub = get_new_node('testpublisher_subscriber'); +my $node_pub_sub = PostgresNode->new('testpublisher_subscriber'); $node_pub_sub->init(allows_streaming => 'logical'); $node_pub_sub->start; -my $node_sub = get_new_node('testsubscriber1'); +my $node_sub = PostgresNode->new('testsubscriber1'); $node_sub->init(allows_streaming => 'logical'); $node_sub->start; |