@@ -33,7 +33,8 @@ PostgresNode - class representing PostgreSQL server instance
33
33
my ($stdout, $stderr, $timed_out);
34
34
my $cmdret = $node->psql('postgres', 'SELECT pg_sleep(600)',
35
35
stdout => \$stdout, stderr => \$stderr,
36
- timeout => 180, timed_out => \$timed_out,
36
+ timeout => $TestLib::timeout_default,
37
+ timed_out => \$timed_out,
37
38
extra_params => ['--single-transaction'],
38
39
on_error_die => 1)
39
40
print "Sleep timed out" if $timed_out;
@@ -1650,7 +1651,8 @@ e.g.
1650
1651
my ($stdout, $stderr, $timed_out);
1651
1652
my $cmdret = $node->psql('postgres', 'SELECT pg_sleep(600)',
1652
1653
stdout => \$stdout, stderr => \$stderr,
1653
- timeout => 180, timed_out => \$timed_out,
1654
+ timeout => $TestLib::timeout_default,
1655
+ timed_out => \$timed_out,
1654
1656
extra_params => ['--single-transaction'])
1655
1657
1656
1658
will set $cmdret to undef and $timed_out to a true value.
@@ -1824,7 +1826,8 @@ scalar reference. This allows the caller to act on other parts of the system
1824
1826
while idling this backend.
1825
1827
1826
1828
The specified timer object is attached to the harness, as well. It's caller's
1827
- responsibility to select the timeout length, and to restart the timer after
1829
+ responsibility to set the timeout length (usually
1830
+ $TestLib::timeout_default), and to restart the timer after
1828
1831
each command if the timeout is per-command.
1829
1832
1830
1833
psql is invoked in tuples-only unaligned mode with reading ofB<.psqlrc >
@@ -1912,9 +1915,10 @@ The process's stdin is sourced from the $stdin scalar reference,
1912
1915
and its stdout and stderr go to the $stdout scalar reference.
1913
1916
ptys are used so that psql thinks it's being called interactively.
1914
1917
1915
- The specified timer object is attached to the harness, as well.
1916
- It's caller's responsibility to select the timeout length, and to
1917
- restart the timer after each command if the timeout is per-command.
1918
+ The specified timer object is attached to the harness, as well. It's caller's
1919
+ responsibility to set the timeout length (usually
1920
+ $TestLib::timeout_default), and to restart the timer after
1921
+ each command if the timeout is per-command.
1918
1922
1919
1923
psql is invoked in tuples-only unaligned mode with reading ofB<.psqlrc >
1920
1924
disabled. That may be overridden by passing extra psql parameters.
@@ -2227,7 +2231,7 @@ sub connect_fails
2227
2231
RunB<$query > repeatedly, until it returns theB<$expected > result
2228
2232
('t', or SQL boolean true, by default).
2229
2233
Continues polling ifB<psql > returns an error result.
2230
- Times out after180 seconds.
2234
+ Times out after$TestLib::timeout_default seconds.
2231
2235
Returns 1 if successful, 0 if timed out.
2232
2236
2233
2237
=cut
@@ -2245,7 +2249,7 @@ sub poll_query_until
2245
2249
' -d' ,$self -> connstr($dbname )
2246
2250
];
2247
2251
my ($stdout ,$stderr );
2248
- my $max_attempts =180 *10 ;
2252
+ my $max_attempts =10 *$TestLib::timeout_default ;
2249
2253
my $attempts = 0;
2250
2254
2251
2255
while ($attempts <$max_attempts )
@@ -2267,8 +2271,8 @@ sub poll_query_until
2267
2271
$attempts ++;
2268
2272
}
2269
2273
2270
- # The query result didn't change in 180 seconds. Give up. Print the
2271
- # output from the last attempt, hopefully that's useful for debugging.
2274
+ # Give up. Print the output from the last attempt, hopefully that's useful
2275
+ # for debugging.
2272
2276
diagqq( poll_query_until timed out executing this query:
2273
2277
$query
2274
2278
expecting this output: