aboutsummaryrefslogtreecommitdiff
path: root/src/test/perl
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2016-06-12 04:19:56 -0400
committerNoah Misch <noah@leadboat.com>2016-06-12 04:19:56 -0400
commit3be0a62ffe58f0753d190cbe22acbeb8b4926b85 (patch)
tree6da431545c91d5f54d56b38208e8f946dcdbd6b4 /src/test/perl
parentb098abf90537edf0ce9c70e8eb55320baf6e445d (diff)
downloadpostgresql-3be0a62ffe58f0753d190cbe22acbeb8b4926b85.tar.gz
postgresql-3be0a62ffe58f0753d190cbe22acbeb8b4926b85.zip
Finish pgindent run for 9.6: Perl files.
Diffstat (limited to 'src/test/perl')
-rw-r--r--src/test/perl/PostgresNode.pm11
-rw-r--r--src/test/perl/RecursiveCopy.pm5
-rw-r--r--src/test/perl/TestLib.pm1
3 files changed, 12 insertions, 5 deletions
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index 4e66006af3b..636dfec5c06 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -103,6 +103,7 @@ our ($test_localhost, $test_pghost, $last_port_assigned, @all_nodes);
INIT
{
+
# PGHOST is set once and for all through a single series of tests when
# this module is loaded.
$test_localhost = "127.0.0.1";
@@ -540,11 +541,12 @@ sub _backup_fs
if ($hot)
{
+
# We ignore pg_stop_backup's return value. We also assume archiving
# is enabled; otherwise the caller will have to copy the remaining
# segments.
- my $stdout = $self->safe_psql('postgres',
- 'SELECT * FROM pg_stop_backup();');
+ my $stdout =
+ $self->safe_psql('postgres', 'SELECT * FROM pg_stop_backup();');
print "# pg_stop_backup: $stdout\n";
}
@@ -842,6 +844,7 @@ sub get_new_node
while ($found == 0)
{
+
# advance $port, wrapping correctly around range end
$port = 49152 if ++$port >= 65536;
print "# Checking port $port\n";
@@ -896,6 +899,7 @@ sub get_new_node
# order, later when the File::Temp objects are destroyed.
END
{
+
# take care not to change the script's exit value
my $exit_code = $?;
@@ -1078,7 +1082,7 @@ sub psql
IPC::Run::timeout($params{timeout}, exception => $timeout_exception)
if (defined($params{timeout}));
- ${$params{timed_out}} = 0 if defined $params{timed_out};
+ ${ $params{timed_out} } = 0 if defined $params{timed_out};
# IPC::Run would otherwise append to existing contents:
$$stdout = "" if ref($stdout);
@@ -1107,6 +1111,7 @@ sub psql
my $exc_save = $@;
if ($exc_save)
{
+
# IPC::Run::run threw an exception. re-throw unless it's a
# timeout, which we'll handle by testing is_expired
die $exc_save
diff --git a/src/test/perl/RecursiveCopy.pm b/src/test/perl/RecursiveCopy.pm
index c4da1bbd837..3e988132868 100644
--- a/src/test/perl/RecursiveCopy.pm
+++ b/src/test/perl/RecursiveCopy.pm
@@ -65,7 +65,7 @@ sub copypath
{
die "if specified, filterfn must be a subroutine reference"
unless defined(ref $params{filterfn})
- and (ref $params{filterfn} eq 'CODE');
+ and (ref $params{filterfn} eq 'CODE');
$filterfn = $params{filterfn};
}
@@ -93,7 +93,8 @@ sub _copypath_recurse
# Can't handle symlinks or other weird things
die "Source path \"$srcpath\" is not a regular file or directory"
- unless -f $srcpath or -d $srcpath;
+ unless -f $srcpath
+ or -d $srcpath;
# Abort if destination path already exists. Should we allow directories
# to exist already?
diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm
index 0057f6dfe9f..649fd821733 100644
--- a/src/test/perl/TestLib.pm
+++ b/src/test/perl/TestLib.pm
@@ -109,6 +109,7 @@ INIT
END
{
+
# Preserve temporary directory for this test on failure
$File::Temp::KEEP_ALL = 1 unless all_tests_passing();
}