Skip to content

Commit 93759c6

Browse files
committed
Fix slow animal timeouts in 032_relfilenode_reuse.pl.
Per BF animal chipmunk: CREATE DATABASE could apparently fail due to an AV process being in the template database and not quitting fast enough for the 5 second timeout in CountOtherDBBackends(). The test script had autovacuum_naptime=1s to encourage more activity and opening of fds, but that wasn't strictly necessary for this test. Take it out. Per BF animal skink: there was a 300s timeout for all tests in the script, but apparently that was not enough under valgrind. Let's use the standard timeout $PostgreSQL::Test::Utils::timeout_default, but restart it for each query we run. Reviewed-by: Robert Haas <robertmhaas@gmail.com> Discussion: https://postgr.es/m/CA%2BhUKGKa8HNJaA24gqiiFoGy0ysndeVoJsHvX_q1-DVLFaGAmw%40mail.gmail.com
1 parent fcab82a commit 93759c6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/test/recovery/t/032_relfilenode_reuse.pl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# to avoid "repairing" corruption
1616
full_page_writes=off
1717
log_min_messages=debug2
18-
autovacuum_naptime=1s
1918
shared_buffers=1MB
2019
]);
2120
$node_primary->start;
@@ -29,11 +28,8 @@
2928
has_streaming => 1);
3029
$node_standby->start;
3130

32-
# To avoid hanging while expecting some specific input from a psql
33-
# instance being driven by us, add a timeout high enough that it
34-
# should never trigger even on very slow machines, unless something
35-
# is really wrong.
36-
my $psql_timeout = IPC::Run::timer(300);
31+
# We'll reset this timeout for each individual query we run.
32+
my $psql_timeout = IPC::Run::timer($PostgreSQL::Test::Utils::timeout_default);
3733

3834
my %psql_primary = (stdin => '', stdout => '', stderr => '');
3935
$psql_primary{run} = IPC::Run::start(
@@ -208,6 +204,12 @@ sub send_query_and_wait
208204
my ($psql, $query, $untl) = @_;
209205
my $ret;
210206

207+
# For each query we run, we'll restart the timeout. Otherwise the timeout
208+
# would apply to the whole test script, and would need to be set very high
209+
# to survive when running under Valgrind.
210+
$psql_timeout->reset();
211+
$psql_timeout->start();
212+
211213
# send query
212214
$$psql{stdin} .= $query;
213215
$$psql{stdin} .= "\n";

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy