@@ -36,7 +36,8 @@ PostgreSQL::Test::Cluster - class representing PostgreSQL server instance
36
36
my ($stdout, $stderr, $timed_out);
37
37
my $cmdret = $node->psql('postgres', 'SELECT pg_sleep(600)',
38
38
stdout => \$stdout, stderr => \$stderr,
39
- timeout => 180, timed_out => \$timed_out,
39
+ timeout => $PostgreSQL::Test::Utils::timeout_default,
40
+ timed_out => \$timed_out,
40
41
extra_params => ['--single-transaction'],
41
42
on_error_die => 1)
42
43
print "Sleep timed out" if $timed_out;
@@ -1723,7 +1724,8 @@ e.g.
1723
1724
my ($stdout, $stderr, $timed_out);
1724
1725
my $cmdret = $node->psql('postgres', 'SELECT pg_sleep(600)',
1725
1726
stdout => \$stdout, stderr => \$stderr,
1726
- timeout => 180, timed_out => \$timed_out,
1727
+ timeout => $PostgreSQL::Test::Utils::timeout_default,
1728
+ timed_out => \$timed_out,
1727
1729
extra_params => ['--single-transaction'])
1728
1730
1729
1731
will set $cmdret to undef and $timed_out to a true value.
@@ -1897,7 +1899,8 @@ scalar reference. This allows the caller to act on other parts of the system
1897
1899
while idling this backend.
1898
1900
1899
1901
The specified timer object is attached to the harness, as well. It's caller's
1900
- responsibility to select the timeout length, and to restart the timer after
1902
+ responsibility to set the timeout length (usually
1903
+ $PostgreSQL::Test::Utils::timeout_default), and to restart the timer after
1901
1904
each command if the timeout is per-command.
1902
1905
1903
1906
psql is invoked in tuples-only unaligned mode with reading of B<.psqlrc >
@@ -1985,9 +1988,10 @@ The process's stdin is sourced from the $stdin scalar reference,
1985
1988
and its stdout and stderr go to the $stdout scalar reference.
1986
1989
ptys are used so that psql thinks it's being called interactively.
1987
1990
1988
- The specified timer object is attached to the harness, as well.
1989
- It's caller's responsibility to select the timeout length, and to
1990
- restart the timer after each command if the timeout is per-command.
1991
+ The specified timer object is attached to the harness, as well. It's caller's
1992
+ responsibility to set the timeout length (usually
1993
+ $PostgreSQL::Test::Utils::timeout_default), and to restart the timer after
1994
+ each command if the timeout is per-command.
1991
1995
1992
1996
psql is invoked in tuples-only unaligned mode with reading of B<.psqlrc >
1993
1997
disabled. That may be overridden by passing extra psql parameters.
@@ -2303,7 +2307,7 @@ sub connect_fails
2303
2307
Run B<$query > repeatedly, until it returns the B<$expected > result
2304
2308
('t', or SQL boolean true, by default).
2305
2309
Continues polling if B<psql > returns an error result.
2306
- Times out after 180 seconds.
2310
+ Times out after $PostgreSQL::Test::Utils::timeout_default seconds.
2307
2311
Returns 1 if successful, 0 if timed out.
2308
2312
2309
2313
=cut
@@ -2321,7 +2325,7 @@ sub poll_query_until
2321
2325
' -d' , $self -> connstr($dbname )
2322
2326
];
2323
2327
my ($stdout , $stderr );
2324
- my $max_attempts = 180 * 10 ;
2328
+ my $max_attempts = 10 * $PostgreSQL::Test::Utils::timeout_default ;
2325
2329
my $attempts = 0;
2326
2330
2327
2331
while ($attempts < $max_attempts )
@@ -2343,8 +2347,8 @@ sub poll_query_until
2343
2347
$attempts ++;
2344
2348
}
2345
2349
2346
- # The query result didn't change in 180 seconds. Give up. Print the
2347
- # output from the last attempt, hopefully that's useful for debugging.
2350
+ # Give up. Print the output from the last attempt, hopefully that's useful
2351
+ # for debugging.
2348
2352
diag qq( poll_query_until timed out executing this query:
2349
2353
$query
2350
2354
expecting this output:
@@ -2657,7 +2661,7 @@ sub wait_for_slot_catchup
2657
2661
2658
2662
Waits for the contents of the server log file, starting at the given offset, to
2659
2663
match the supplied regular expression. Checks the entire log if no offset is
2660
- given. Times out after 180 seconds.
2664
+ given. Times out after $PostgreSQL::Test::Utils::timeout_default seconds.
2661
2665
2662
2666
If successful, returns the length of the entire log file, in bytes.
2663
2667
@@ -2668,7 +2672,7 @@ sub wait_for_log
2668
2672
my ($self , $regexp , $offset ) = @_ ;
2669
2673
$offset = 0 unless defined $offset ;
2670
2674
2671
- my $max_attempts = 180 * 10 ;
2675
+ my $max_attempts = 10 * $PostgreSQL::Test::Utils::timeout_default ;
2672
2676
my $attempts = 0;
2673
2677
2674
2678
while ($attempts < $max_attempts )
@@ -2683,7 +2687,6 @@ sub wait_for_log
2683
2687
$attempts ++;
2684
2688
}
2685
2689
2686
- # The logs didn't match within 180 seconds. Give up.
2687
2690
croak " timed out waiting for match: $regexp " ;
2688
2691
}
2689
2692
0 commit comments