diff options
author | Amit Kapila | 2022-09-08 04:17:43 +0000 |
---|---|---|
committer | Amit Kapila | 2022-09-08 04:17:43 +0000 |
commit | 0324651573479f4e782f76c0d06f2ebd02e6160a (patch) | |
tree | da83e310f25030f35f4b52f80ff0f353a58f6368 /src | |
parent | 875693019053b8897ec3983e292acbb439b088c3 (diff) |
Fix the test case introduced by commit 8756930190.
Before dropping a relation, ensure that it has reached a 'ready' state
after initial synchronization.
Author: Vignesh C
Reviewed-By: Amit Kapila
Discussion: https://www.postgresql.org/message-id/CALDaNm0gwjY_4HFxvvty01BOT01q_fJLKQ3pWP9=9orqubhjcQ@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r-- | src/test/subscription/t/030_origin.pl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/test/subscription/t/030_origin.pl b/src/test/subscription/t/030_origin.pl index 0a5cc4503bd..d3b78d4b3e2 100644 --- a/src/test/subscription/t/030_origin.pl +++ b/src/test/subscription/t/030_origin.pl @@ -195,7 +195,13 @@ like( "Refresh publication when the publisher has subscribed for the new table, but the subscriber-side wants origin = none" ); -$node_A->wait_for_subscription_sync($node_B, $subname_AB2); +# Ensure that relation has reached 'ready' state before we try to drop it +my $synced_query = + "SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('r');"; +$node_A->poll_query_until('postgres', $synced_query) + or die "Timed out while waiting for subscriber to synchronize data"; + +$node_B->wait_for_catchup($subname_AB2); # clear the operations done by this test $node_A->safe_psql('postgres', "DROP TABLE tab_new"); |