aboutsummaryrefslogtreecommitdiff
path: root/src/test/perl/PostgreSQL/Test/Utils.pm
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2022-03-04 18:53:13 -0800
committerNoah Misch <noah@leadboat.com>2022-03-04 18:53:13 -0800
commitf2698ea02ca8a56f38935d2b300ac54936712558 (patch)
treefa031ce71f9acf7327c3898e708682838fe210a4 /src/test/perl/PostgreSQL/Test/Utils.pm
parent9240589798e02705dbe3e86549d064988c0f47d2 (diff)
downloadpostgresql-f2698ea02ca8a56f38935d2b300ac54936712558.tar.gz
postgresql-f2698ea02ca8a56f38935d2b300ac54936712558.zip
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
Diffstat (limited to 'src/test/perl/PostgreSQL/Test/Utils.pm')
-rw-r--r--src/test/perl/PostgreSQL/Test/Utils.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/test/perl/PostgreSQL/Test/Utils.pm b/src/test/perl/PostgreSQL/Test/Utils.pm
index 46cd7467963..15b314d1f89 100644
--- a/src/test/perl/PostgreSQL/Test/Utils.pm
+++ b/src/test/perl/PostgreSQL/Test/Utils.pm
@@ -91,8 +91,8 @@ our @EXPORT = qw(
$use_unix_sockets
);
-our ($windows_os, $is_msys2, $use_unix_sockets, $tmp_check, $log_path,
- $test_logfile);
+our ($windows_os, $is_msys2, $use_unix_sockets, $timeout_default,
+ $tmp_check, $log_path, $test_logfile);
BEGIN
{
@@ -157,6 +157,10 @@ BEGIN
# supported, but it can be overridden if desired.
$use_unix_sockets =
(!$windows_os || defined $ENV{PG_TEST_USE_UNIX_SOCKETS});
+
+ $timeout_default = $ENV{PG_TEST_TIMEOUT_DEFAULT};
+ $timeout_default = 180
+ if not defined $timeout_default or $timeout_default eq '';
}
=pod