aboutsummaryrefslogtreecommitdiff
path: root/src/test/perl/PostgresNode.pm
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2021-07-29 05:58:08 -0400
committerAndrew Dunstan <andrew@dunslane.net>2021-07-29 05:58:08 -0400
commit5dc932f9e7b7d1992abd33d1c519899dd1c30272 (patch)
tree22d79c215b4a9909a067453ff4c0405dab865489 /src/test/perl/PostgresNode.pm
parent201a76183e2056c2217129e12d68c25ec9c559c8 (diff)
downloadpostgresql-5dc932f9e7b7d1992abd33d1c519899dd1c30272.tar.gz
postgresql-5dc932f9e7b7d1992abd33d1c519899dd1c30272.zip
Remove the last vestiges of Exporter from PostgresNode
Clients wanting to call get_free_port now need to do so via a qualified name: PostgresNode::get_free_port().
Diffstat (limited to 'src/test/perl/PostgresNode.pm')
-rw-r--r--src/test/perl/PostgresNode.pm14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index 45c69a61baf..5cfcbcf810b 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -69,7 +69,7 @@ PostgresNode - class representing PostgreSQL server instance
$node->stop('fast');
# Find a free, unprivileged TCP port to bind some other service to
- my $port = get_free_port();
+ my $port = PostgresNode::get_free_port();
=head1 DESCRIPTION
@@ -93,7 +93,6 @@ use warnings;
use Carp;
use Config;
use Cwd;
-use Exporter 'import';
use Fcntl qw(:mode);
use File::Basename;
use File::Path qw(rmtree);
@@ -109,10 +108,6 @@ use TestLib ();
use Time::HiRes qw(usleep);
use Scalar::Util qw(blessed);
-our @EXPORT = qw(
- get_free_port
-);
-
our ($use_tcp, $test_localhost, $test_pghost, $last_host_assigned,
$last_port_assigned, @all_nodes, $died);
@@ -1381,8 +1376,8 @@ sub installed_command
=item get_free_port()
Locate an unprivileged (high) TCP port that's not currently bound to
-anything. This is used by new(), and is also exported for use
-by test cases that need to start other, non-Postgres servers.
+anything. This is used by C<new()>, and also by some test cases that need to
+start other, non-Postgres servers.
Ports assigned to existing PostgresNode objects are automatically
excluded, even if those servers are not currently running.
@@ -1390,6 +1385,9 @@ excluded, even if those servers are not currently running.
XXX A port available now may become unavailable by the time we start
the desired service.
+Note: this is not an instance method. As it's not exported it should be
+called from outside the module as C<PostgresNode::get_free_port()>.
+
=cut
sub get_free_port