Skip to content

Commit 529ab7b

Browse files
committed
Fix timing issue in new subscription truncate test
We need to wait for the initial sync of all subscriptions. On some (faster?) machines, this didn't make a difference, but the (slower?) buildfarm machines are upset.
1 parent bf75fe4 commit 529ab7b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/test/subscription/t/010_truncate.pl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@
6161
$node_subscriber->safe_psql('postgres',
6262
"CREATE SUBSCRIPTION sub3 CONNECTION '$publisher_connstr application_name=sub3' PUBLICATION pub3");
6363

64-
$node_publisher->wait_for_catchup('sub1');
64+
# Wait for initial sync of all subscriptions
65+
my $synced_query =
66+
"SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('r', 's');";
67+
$node_subscriber->poll_query_until('postgres', $synced_query)
68+
or die "Timed out while waiting for subscriber to synchronize data";
6569

6670
# insert data to truncate
6771

0 commit comments

Comments
 (0)