aboutsummaryrefslogtreecommitdiff
path: root/src/test/perl/PostgresNode.pm
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/perl/PostgresNode.pm')
-rw-r--r--src/test/perl/PostgresNode.pm17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index a106ba1cb39..ff6931c0bfb 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -31,7 +31,8 @@ PostgresNode - class representing PostgreSQL server instance
my ($stdout, $stderr, $timed_out);
my $cmdret = $node->psql('postgres', 'SELECT pg_sleep(600)',
stdout => \$stdout, stderr => \$stderr,
- timeout => 180, timed_out => \$timed_out,
+ timeout => $TestLib::timeout_default,
+ timed_out => \$timed_out,
extra_params => ['--single-transaction'],
on_error_die => 1)
print "Sleep timed out" if $timed_out;
@@ -1412,7 +1413,8 @@ e.g.
my ($stdout, $stderr, $timed_out);
my $cmdret = $node->psql('postgres', 'SELECT pg_sleep(600)',
stdout => \$stdout, stderr => \$stderr,
- timeout => 180, timed_out => \$timed_out,
+ timeout => $TestLib::timeout_default,
+ timed_out => \$timed_out,
extra_params => ['--single-transaction'])
will set $cmdret to undef and $timed_out to a true value.
@@ -1569,7 +1571,8 @@ scalar reference. This allows the caller to act on other parts of the system
while idling this backend.
The specified timer object is attached to the harness, as well. It's caller's
-responsibility to select the timeout length, and to restart the timer after
+responsibility to set the timeout length (usually
+$TestLib::timeout_default), and to restart the timer after
each command if the timeout is per-command.
psql is invoked in tuples-only unaligned mode with reading of B<.psqlrc>
@@ -1741,7 +1744,7 @@ sub pgbench
Run B<$query> repeatedly, until it returns the B<$expected> result
('t', or SQL boolean true, by default).
Continues polling if B<psql> returns an error result.
-Times out after 180 seconds.
+Times out after $TestLib::timeout_default seconds.
Returns 1 if successful, 0 if timed out.
=cut
@@ -1754,7 +1757,7 @@ sub poll_query_until
my $cmd = [ 'psql', '-XAt', '-d', $self->connstr($dbname) ];
my ($stdout, $stderr);
- my $max_attempts = 180 * 10;
+ my $max_attempts = 10 * $TestLib::timeout_default;
my $attempts = 0;
while ($attempts < $max_attempts)
@@ -1776,8 +1779,8 @@ sub poll_query_until
$attempts++;
}
- # The query result didn't change in 180 seconds. Give up. Print the
- # output from the last attempt, hopefully that's useful for debugging.
+ # Give up. Print the output from the last attempt, hopefully that's useful
+ # for debugging.
diag qq(poll_query_until timed out executing this query:
$query
expecting this output: