1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-05 07:41:25 +03:00

Introduce PG_TEST_TIMEOUT_DEFAULT for TAP suite non-elapsing timeouts.

Slow hosts may avoid load-induced, spurious failures by setting
environment variable PG_TEST_TIMEOUT_DEFAULT to some number of seconds
greater than 180.  Developers may see faster failures by setting that
environment variable to some lesser number of seconds.  In tests, write
$PostgreSQL::Test::Utils::timeout_default wherever the convention has
been to write 180.  This change raises the default for some briefer
timeouts.  Back-patch to v10 (all supported versions).

Discussion: https://postgr.es/m/20220218052842.GA3627003@rfd.leadboat.com
This commit is contained in:
Noah Misch
2022-03-04 18:53:13 -08:00
parent 9240589798
commit f2698ea02c
20 changed files with 75 additions and 65 deletions

View File

@@ -39,7 +39,7 @@ sub check_log_pattern
my $node = shift;
my $lfname = fetch_file_name($logfiles, $format);
my $max_attempts = 180 * 10;
my $max_attempts = 10 * $PostgreSQL::Test::Utils::timeout_default;
my $logcontents;
for (my $attempts = 0; $attempts < $max_attempts; $attempts++)
@@ -78,7 +78,7 @@ $node->start();
$node->psql('postgres', 'SELECT 1/0');
# might need to retry if logging collector process is slow...
my $max_attempts = 180 * 10;
my $max_attempts = 10 * $PostgreSQL::Test::Utils::timeout_default;
my $current_logfiles;
for (my $attempts = 0; $attempts < $max_attempts; $attempts++)