mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
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
This commit is contained in:
@ -137,7 +137,10 @@ WHERE locktype = 'relation'
|
|||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
-- The above CLUSTER command shouldn't cause a timeout on 2pc decoding.
|
-- 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');
|
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
|
||||||
data
|
data
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
@ -69,7 +69,10 @@ FROM pg_locks
|
|||||||
WHERE locktype = 'relation'
|
WHERE locktype = 'relation'
|
||||||
AND relation = 'test_prepared1'::regclass;
|
AND relation = 'test_prepared1'::regclass;
|
||||||
-- The above CLUSTER command shouldn't cause a timeout on 2pc decoding.
|
-- 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');
|
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
|
||||||
RESET statement_timeout;
|
RESET statement_timeout;
|
||||||
COMMIT PREPARED 'test_prepared_lock';
|
COMMIT PREPARED 'test_prepared_lock';
|
||||||
|
@ -34,7 +34,10 @@ declare
|
|||||||
updated3 bool;
|
updated3 bool;
|
||||||
updated4 bool;
|
updated4 bool;
|
||||||
begin
|
begin
|
||||||
-- we don't want to wait forever; loop will exit after 30 seconds
|
-- We don't want to wait forever. No timeout suffices if the OS drops our
|
||||||
|
-- stats traffic because an earlier test file left a full UDP buffer.
|
||||||
|
-- Hence, don't use PG_TEST_TIMEOUT_DEFAULT, which may be large for
|
||||||
|
-- can't-happen timeouts. Exit after 30 seconds.
|
||||||
for i in 1 .. 300 loop
|
for i in 1 .. 300 loop
|
||||||
|
|
||||||
-- With parallel query, the seqscan and indexscan on tenk2 might be done
|
-- With parallel query, the seqscan and indexscan on tenk2 might be done
|
||||||
|
@ -33,7 +33,10 @@ declare
|
|||||||
updated3 bool;
|
updated3 bool;
|
||||||
updated4 bool;
|
updated4 bool;
|
||||||
begin
|
begin
|
||||||
-- we don't want to wait forever; loop will exit after 30 seconds
|
-- We don't want to wait forever. No timeout suffices if the OS drops our
|
||||||
|
-- stats traffic because an earlier test file left a full UDP buffer.
|
||||||
|
-- Hence, don't use PG_TEST_TIMEOUT_DEFAULT, which may be large for
|
||||||
|
-- can't-happen timeouts. Exit after 30 seconds.
|
||||||
for i in 1 .. 300 loop
|
for i in 1 .. 300 loop
|
||||||
|
|
||||||
-- With parallel query, the seqscan and indexscan on tenk2 might be done
|
-- With parallel query, the seqscan and indexscan on tenk2 might be done
|
||||||
|
Reference in New Issue
Block a user