Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Misch2022-03-05 02:53:13 +0000
committerNoah Misch2022-03-05 02:53:13 +0000
commit766075105c21442418359221e0a0da43040b273c (patch)
tree1c78a4c7fc1a18b51e7e4f93cdd863ca9b4d2c3a /contrib/test_decoding/sql
parentf2698ea02ca8a56f38935d2b300ac54936712558 (diff)
Use PG_TEST_TIMEOUT_DEFAULT for pg_regress suite non-elapsing timeouts.
Currently, only contrib/test_decoding has this property. Use \getenv to load the timeout value. Discussion: https://postgr.es/m/20220218052842.GA3627003@rfd.leadboat.com
Diffstat (limited to 'contrib/test_decoding/sql')
-rw-r--r--contrib/test_decoding/sql/twophase.sql5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/test_decoding/sql/twophase.sql b/contrib/test_decoding/sql/twophase.sql
index 05f18e84948..aff5114eb10 100644
--- a/contrib/test_decoding/sql/twophase.sql
+++ b/contrib/test_decoding/sql/twophase.sql
@@ -69,7 +69,10 @@ FROM pg_locks
WHERE locktype = 'relation'
AND relation = 'test_prepared1'::regclass;
-- The above CLUSTER command shouldn't cause a timeout on 2pc decoding.
-SET statement_timeout = '180s';
+\set env_timeout ''
+\getenv env_timeout PG_TEST_TIMEOUT_DEFAULT
+SELECT COALESCE(NULLIF(:'env_timeout', ''), '180') || 's' AS timeout \gset
+SET statement_timeout = :'timeout';
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
RESET statement_timeout;
COMMIT PREPARED 'test_prepared_lock';