On 2019-Jun-17, Michael Paquier wrote: > Attached is a patch to improve the stability of the test. The fix I > am proposing is very simple: in order to make sure that a standby is > added into the WAL sender array of the primary, let's check after > pg_stat_replication after a standby is started. This can be done > consistently with a small wrapper in the tests. > > Any thoughts?
Hmm, this introduces a bit of latency: it waits for each standby to be fully up before initializing the next standby. Maybe it would be more convenient to split the primitives: keep the current one to start the standby, and add a separate one to wait for it to be registered. Then we could do standby1->start; standby2->start; standby3->start; foreach my $sby (@standbys) { $sby->wait_for_standby } so they all start in parallel, saving a bit of time. > + print "### Waiting for standby \"$standby_name\" on \"$master_name\"\n"; I think this should be note() rather than print(), or maybe diag(). (I see that we have a couple of other cases which use print() in the tap tests, which I think should be note() as well.) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services