Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit eef34e5

Browse files
committed
test_decoding: Protect against rare spurious test failures.
A bunch of tests missed specifying that empty transactions shouldn't be displayed. That causes problems when e.g. autovacuum runs in an unfortunate moment. The tests in question only run for a very short time, making this quite unlikely. Reported-By: Buildfarm member axolotl Backpatch: 9.4, where logical decoding was introduced
1 parent 98d5b08 commit eef34e5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

contrib/test_decoding/expected/binary.out

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_d
77
(1 row)
88

99
-- succeeds, textual plugin, textual consumer
10-
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'force-binary', '0');
10+
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'force-binary', '0', 'skip-empty-xacts', '1');
1111
data
1212
------
1313
(0 rows)
1414

1515
-- fails, binary plugin, textual consumer
16-
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'force-binary', '1');
16+
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'force-binary', '1', 'skip-empty-xacts', '1');
1717
ERROR: logical decoding output plugin "test_decoding" produces binary output, but "pg_logical_slot_get_changes(name,pg_lsn,integer,text[])" expects textual data
1818
-- succeeds, textual plugin, binary consumer
19-
SELECT data FROM pg_logical_slot_get_binary_changes('regression_slot', NULL, NULL, 'force-binary', '0');
19+
SELECT data FROM pg_logical_slot_get_binary_changes('regression_slot', NULL, NULL, 'force-binary', '0', 'skip-empty-xacts', '1');
2020
data
2121
------
2222
(0 rows)
2323

2424
-- succeeds, binary plugin, binary consumer
25-
SELECT data FROM pg_logical_slot_get_binary_changes('regression_slot', NULL, NULL, 'force-binary', '1');
25+
SELECT data FROM pg_logical_slot_get_binary_changes('regression_slot', NULL, NULL, 'force-binary', '1', 'skip-empty-xacts', '1');
2626
data
2727
------
2828
(0 rows)

contrib/test_decoding/sql/binary.sql

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ SET synchronous_commit = on;
33

44
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
55
-- succeeds, textual plugin, textual consumer
6-
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'force-binary', '0');
6+
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'force-binary', '0', 'skip-empty-xacts', '1');
77
-- fails, binary plugin, textual consumer
8-
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'force-binary', '1');
8+
SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'force-binary', '1', 'skip-empty-xacts', '1');
99
-- succeeds, textual plugin, binary consumer
10-
SELECT data FROM pg_logical_slot_get_binary_changes('regression_slot', NULL, NULL, 'force-binary', '0');
10+
SELECT data FROM pg_logical_slot_get_binary_changes('regression_slot', NULL, NULL, 'force-binary', '0', 'skip-empty-xacts', '1');
1111
-- succeeds, binary plugin, binary consumer
12-
SELECT data FROM pg_logical_slot_get_binary_changes('regression_slot', NULL, NULL, 'force-binary', '1');
12+
SELECT data FROM pg_logical_slot_get_binary_changes('regression_slot', NULL, NULL, 'force-binary', '1', 'skip-empty-xacts', '1');
1313

1414
SELECT 'init' FROM pg_drop_replication_slot('regression_slot');

0 commit comments

Comments
 (0)