Skip to content

Commit 6adc537

Browse files
committed
postgres_fdw: Stabilize regression test for postgres_fdw_disconnect_all().
The regression test added in commit 411ae64 caused buildfarm failures. The cause of them was that the order of warning messages output in the test was not stable. To fix this, this commit sets client_min_messages to ERROR temporarily when performing the test generating those warnings. Per buildfarm failures. Discussion: https://postgr.es/m/2147113.1611644754@sss.pgh.pa.us
1 parent 411ae64 commit 6adc537

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

contrib/postgres_fdw/expected/postgres_fdw.out

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9216,15 +9216,15 @@ NOTICE: drop cascades to 2 other objects
92169216
DETAIL: drop cascades to user mapping for public on server loopback4
92179217
drop cascades to foreign table ft8
92189218
-- Return false as connections are still in use, warnings are issued.
9219+
-- But disable warnings temporarily because the order of them is not stable.
9220+
SET client_min_messages = 'ERROR';
92199221
SELECT postgres_fdw_disconnect_all();
9220-
WARNING: cannot close dropped server connection because it is still in use
9221-
WARNING: cannot close connection for server "loopback" because it is still in use
9222-
WARNING: cannot close connection for server "loopback2" because it is still in use
92239222
postgres_fdw_disconnect_all
92249223
-----------------------------
92259224
f
92269225
(1 row)
92279226

9227+
RESET client_min_messages;
92289228
COMMIT;
92299229
-- Close loopback2 connection and return true.
92309230
SELECT postgres_fdw_disconnect('loopback2');

contrib/postgres_fdw/sql/postgres_fdw.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2779,7 +2779,10 @@ SELECT 1 FROM ft8 LIMIT 1;
27792779
SELECT * FROM postgres_fdw_get_connections() ORDER BY 1;
27802780
DROP SERVER loopback4 CASCADE;
27812781
-- Return false as connections are still in use, warnings are issued.
2782+
-- But disable warnings temporarily because the order of them is not stable.
2783+
SET client_min_messages = 'ERROR';
27822784
SELECT postgres_fdw_disconnect_all();
2785+
RESET client_min_messages;
27832786
COMMIT;
27842787
-- Close loopback2 connection and return true.
27852788
SELECT postgres_fdw_disconnect('loopback2');

0 commit comments

Comments
 (0)