From: Simon Riggs Date: Fri, 1 Sep 2017 13:55:44 +0000 (+0100) Subject: Avoid race condition in logical replication test X-Git-Tag: REL_11_BETA1~1699 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f27c674fd9fb5ba1f2952e2db53886bb5954e8b;p=postgresql Avoid race condition in logical replication test Wait for slot to become inactive before continuing. Author: Petr Jelinek --- diff --git a/src/test/recovery/t/006_logical_decoding.pl b/src/test/recovery/t/006_logical_decoding.pl index 4a90e9ac7e..8b35bc8438 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',