summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2018-04-07 16:57:53 +0000
committerPeter Eisentraut2018-04-07 16:57:53 +0000
commit529ab7bd1fb9c836fe5ccd96f79329d407522e20 (patch)
treef4f16a636bfcb21db638c9776cbbe31cebea50f3
parentbf75fe47e444c01a35992a38a01d32b191f69aca (diff)
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.
-rw-r--r--src/test/subscription/t/010_truncate.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/subscription/t/010_truncate.pl b/src/test/subscription/t/010_truncate.pl
index 8ea4ab624f0..fe9e0b9ec71 100644
--- a/src/test/subscription/t/010_truncate.pl
+++ b/src/test/subscription/t/010_truncate.pl
@@ -61,7 +61,11 @@ $node_subscriber->safe_psql('postgres',
$node_subscriber->safe_psql('postgres',
"CREATE SUBSCRIPTION sub3 CONNECTION '$publisher_connstr application_name=sub3' PUBLICATION pub3");
-$node_publisher->wait_for_catchup('sub1');
+# Wait for initial sync of all subscriptions
+my $synced_query =
+"SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('r', 's');";
+$node_subscriber->poll_query_until('postgres', $synced_query)
+ or die "Timed out while waiting for subscriber to synchronize data";
# insert data to truncate