aboutsummaryrefslogtreecommitdiff
path: root/src/test/perl/PostgreSQL/Test/BackgroundPsql.pm
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/perl/PostgreSQL/Test/BackgroundPsql.pm')
-rw-r--r--src/test/perl/PostgreSQL/Test/BackgroundPsql.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/test/perl/PostgreSQL/Test/BackgroundPsql.pm b/src/test/perl/PostgreSQL/Test/BackgroundPsql.pm
index 764f0a53801..4091c311b8a 100644
--- a/src/test/perl/PostgreSQL/Test/BackgroundPsql.pm
+++ b/src/test/perl/PostgreSQL/Test/BackgroundPsql.pm
@@ -1,5 +1,5 @@
-# Copyright (c) 2021-2023, PostgreSQL Global Development Group
+# Copyright (c) 2021-2024, PostgreSQL Global Development Group
=pod
@@ -54,7 +54,7 @@ initiated by PostgreSQL::Test::Cluster.
package PostgreSQL::Test::BackgroundPsql;
use strict;
-use warnings;
+use warnings FATAL => 'all';
use Carp;
use Config;
@@ -68,7 +68,7 @@ use Test::More;
=over
-=item PostgreSQL::Test::BackgroundPsql->new(interactive, @params)
+=item PostgreSQL::Test::BackgroundPsql->new(interactive, @psql_params, timeout)
Builds a new object of class C<PostgreSQL::Test::BackgroundPsql> for either
an interactive or background session and starts it. If C<interactive> is
@@ -81,7 +81,7 @@ string. For C<interactive> sessions, IO::Pty is required.
sub new
{
my $class = shift;
- my ($interactive, $psql_params) = @_;
+ my ($interactive, $psql_params, $timeout) = @_;
my $psql = {
'stdin' => '',
'stdout' => '',
@@ -96,8 +96,10 @@ sub new
"Forbidden caller of constructor: package: $package, file: $file:$line"
unless $package->isa('PostgreSQL::Test::Cluster');
- $psql->{timeout} =
- IPC::Run::timeout($PostgreSQL::Test::Utils::timeout_default);
+ $psql->{timeout} = IPC::Run::timeout(
+ defined($timeout)
+ ? $timeout
+ : $PostgreSQL::Test::Utils::timeout_default);
if ($interactive)
{