Wait for subscription to sync in t/031_column_list.sql
authorTomas Vondra <tomas.vondra@postgresql.org>
Sat, 26 Mar 2022 23:11:38 +0000 (00:11 +0100)
committerTomas Vondra <tomas.vondra@postgresql.org>
Sat, 26 Mar 2022 23:11:38 +0000 (00:11 +0100)
One of the TAP tests added in 923def9a53 did not wait after creating a
subscription, and wait_for_catchup is not sufficient for this. So if the
tablesync workers happen do not complete quickly enough, the test won't
see the expected results.

This probably explains intermittent failures on a couple buildfarm
animals (komodoensis, petalura and snapper).

Reported-by: Tom Lane
Discussion: https://postgr.es/m/170549.1648330634@sss.pgh.pa.us

src/test/subscription/t/031_column_list.pl

index c778840f4c1b54a9b2107eb064fc55a6732a059c..bdcf3e4a2483ba1e0c3bd0f0eb7bfe109f501bc0 100644 (file)
@@ -722,7 +722,7 @@ $node_subscriber->safe_psql('postgres', qq(
    CREATE SUBSCRIPTION sub1 CONNECTION '$publisher_connstr' PUBLICATION pub8;
 ));
 
-$node_publisher->wait_for_catchup('sub1');
+wait_for_subscription_sync($node_subscriber);
 
 $node_publisher->safe_psql('postgres', qq(
    INSERT INTO test_part_c VALUES (3, 7, 8);