aboutsummaryrefslogtreecommitdiff
path: root/src/test/perl/PostgreSQL/Test/Cluster.pm
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/perl/PostgreSQL/Test/Cluster.pm')
-rw-r--r--src/test/perl/PostgreSQL/Test/Cluster.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm
index e5526c7565f..508e5e3917a 100644
--- a/src/test/perl/PostgreSQL/Test/Cluster.pm
+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm
@@ -1194,6 +1194,9 @@ this to fail. Otherwise, tests might fail to detect server crashes.
With optional extra param fail_ok => 1, returns 0 for failure
instead of bailing out.
+The optional extra param timeout can be used to pass the pg_ctl
+--timeout option.
+
=cut
sub stop
@@ -1209,8 +1212,11 @@ sub stop
return 1 unless defined $self->{_pid};
print "### Stopping node \"$name\" using mode $mode\n";
- $ret = PostgreSQL::Test::Utils::system_log('pg_ctl', '-D', $pgdata,
- '-m', $mode, 'stop');
+ my @cmd = ('pg_ctl', '-D', $pgdata, '-m', $mode, 'stop');
+ if ($params{timeout}) {
+ push(@cmd, ('--timeout', $params{timeout}));
+ }
+ $ret = PostgreSQL::Test::Utils::system_log(@cmd);
if ($ret != 0)
{