aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2020-10-15 09:48:36 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2020-10-15 09:48:36 -0300
commit7f4708818317f59a0452f549dedf4ce35182c13f (patch)
treedf8f4c46f3d5e3e17b04b4fdb5315e7af5cf695f /src
parent86dba33217bb0b48fcf59da76912c3382b4418cd (diff)
downloadpostgresql-7f4708818317f59a0452f549dedf4ce35182c13f.tar.gz
postgresql-7f4708818317f59a0452f549dedf4ce35182c13f.zip
Fix query in new test to check tables are synced
Rather than looking for tablesync workers, it is more reliable to see the sync state of the tables. Per note from Amit Kapila. Discussion: https://postgr.es/m/CAA4eK1JSSD7FVwq+_rOme86jUZTQFzjsNU06hQ4-LiRt1xFmSg@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/test/subscription/t/100_bugs.pl10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/subscription/t/100_bugs.pl b/src/test/subscription/t/100_bugs.pl
index 7dc8983d6ae..d1e407aacb3 100644
--- a/src/test/subscription/t/100_bugs.pl
+++ b/src/test/subscription/t/100_bugs.pl
@@ -141,13 +141,13 @@ $node_twoways->safe_psql(
# We cannot rely solely on wait_for_catchup() here; it isn't sufficient
# when tablesync workers might still be running. So in addition to that,
-# we verify that no tablesync workers appear for the subscription.
+# verify that tables are synced.
# XXX maybe this should be integrated in wait_for_catchup() itself.
$node_twoways->wait_for_catchup('testsub');
-$node_twoways->poll_query_until(
- 'd2',
- "SELECT count(*) FROM pg_stat_subscription WHERE subname = 'testsub' AND relid <> 0",
- "0");
+my $synced_query =
+ "SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('r', 's');";
+$node_twoways->poll_query_until('d2', $synced_query)
+ or die "Timed out while waiting for subscriber to synchronize data";
is($node_twoways->safe_psql('d2', "SELECT count(f) FROM t"),
$rows * 2, "2x$rows rows in t");