summaryrefslogtreecommitdiff
path: root/src/bin/pg_rewind/RewindTest.pm
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-01-08 17:32:09 -0500
committerPeter Eisentraut <peter_e@gmx.net>2018-01-11 13:35:38 -0500
commitbbd3363e128daec0e70952c1bb2f12ab1f6f1292 (patch)
tree3713cabf22276c9d50b0f40acdde71d7272297fd /src/bin/pg_rewind/RewindTest.pm
parent4d41b2e0926548e338d20875729a55d41289f867 (diff)
Refactor subscription tests to use PostgresNode's wait_for_catchup
This was nearly the same code. Extend wait_for_catchup to allow waiting for pg_current_wal_lsn() and use that in the subscription tests. Also change one use in the pg_rewind tests to use this. Also remove some broken code in wait_for_catchup and wait_for_slot_catchup. The error message in case the waiting failed wanted to show the current LSN, but the way it was written never worked. So since nobody ever cared, just remove it. Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
Diffstat (limited to 'src/bin/pg_rewind/RewindTest.pm')
-rw-r--r--src/bin/pg_rewind/RewindTest.pm5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/bin/pg_rewind/RewindTest.pm b/src/bin/pg_rewind/RewindTest.pm
index e6041f38a50..42fd577f219 100644
--- a/src/bin/pg_rewind/RewindTest.pm
+++ b/src/bin/pg_rewind/RewindTest.pm
@@ -163,10 +163,7 @@ sub promote_standby
# up standby
# Wait for the standby to receive and write all WAL.
- my $wal_received_query =
-"SELECT pg_current_wal_lsn() = write_lsn FROM pg_stat_replication WHERE application_name = 'rewind_standby';";
- $node_master->poll_query_until('postgres', $wal_received_query)
- or die "Timed out while waiting for standby to receive and write WAL";
+ $node_master->wait_for_catchup('rewind_standby', 'write');
# Now promote standby and insert some new data on master, this will put
# the master out-of-sync with the standby.