summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2017-09-01 14:49:06 +0100
committerSimon Riggs <simon@2ndQuadrant.com>2017-09-01 14:49:06 +0100
commit3950e07eb46ebe99331ca82d659269056470f596 (patch)
treeca7b31a79336c230003790a8f5322d524de76d1a
parent44654f3d2555702279d080e87c70730dc0cb7a9d (diff)
Avoid race condition in logical replication test
Wait for slot to become inactive before continuing. Author: Petr Jelinek
-rw-r--r--src/test/recovery/t/006_logical_decoding.pl5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/recovery/t/006_logical_decoding.pl b/src/test/recovery/t/006_logical_decoding.pl
index 4a90e9ac7e2..8b35bc84381 100644
--- a/src/test/recovery/t/006_logical_decoding.pl
+++ b/src/test/recovery/t/006_logical_decoding.pl
@@ -78,6 +78,11 @@ chomp($stdout_recv);
is($stdout_recv, $expected,
'got same expected output from pg_recvlogical decoding session');
+$node_master->poll_query_until('postgres',
+"SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'test_slot' AND active_pid IS NULL)"
+)
+ or die "slot never became inactive";
+
$stdout_recv = $node_master->pg_recvlogical_upto(
'postgres', 'test_slot', $endpos, 10,
'include-xids' => '0',