diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-09-20 11:28:34 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-09-20 11:28:34 -0400 |
commit | ee266774454d5cce3375145e2f86a99910eb263f (patch) | |
tree | 954b83482d1024b19da72c9bbdd851f29939673b /src | |
parent | e77730721f5faddb28fd11912f7968ddfd8b58c2 (diff) | |
download | postgresql-ee266774454d5cce3375145e2f86a99910eb263f.tar.gz postgresql-ee266774454d5cce3375145e2f86a99910eb263f.zip |
Fix instability in subscription regression test.
005_encoding.pl neglected to wait for the subscriber's initial
synchronization to happen. While we have not seen this fail in
the buildfarm, it's pretty easy to demonstrate there's an issue
by hacking logicalrep_worker_launch() to fail most of the time.
Michael Paquier
Discussion: https://postgr.es/m/27032.1505749806@sss.pgh.pa.us
Diffstat (limited to 'src')
-rw-r--r-- | src/test/subscription/t/005_encoding.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/subscription/t/005_encoding.pl b/src/test/subscription/t/005_encoding.pl index 26a40c0b7f1..2b0c47c07d3 100644 --- a/src/test/subscription/t/005_encoding.pl +++ b/src/test/subscription/t/005_encoding.pl @@ -41,6 +41,12 @@ $node_subscriber->safe_psql('postgres', wait_for_caught_up($node_publisher, $appname); +# Wait for initial sync to finish as well +my $synced_query = + "SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('s', 'r');"; +$node_subscriber->poll_query_until('postgres', $synced_query) + or die "Timed out while waiting for subscriber to synchronize data"; + $node_publisher->safe_psql('postgres', q{INSERT INTO test1 VALUES (1, E'Mot\xc3\xb6rhead')}); # hand-rolled UTF-8 |