From dd449396060c71c34bcb03e5c1c5de0cb0868da0 Mon Sep 17 00:00:00 2001 From: Sergey Tatarintsev Date: Tue, 16 Jun 2026 11:57:39 +0700 Subject: [PATCH] Fix 004_timeline_switch TAP test: wait for standbys starts before primary stops --- src/test/recovery/t/004_timeline_switch.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/recovery/t/004_timeline_switch.pl b/src/test/recovery/t/004_timeline_switch.pl index e0b3851927c..c87f079cef8 100644 --- a/src/test/recovery/t/004_timeline_switch.pl +++ b/src/test/recovery/t/004_timeline_switch.pl @@ -30,6 +30,10 @@ $node_standby_2->init_from_backup($node_primary, $backup_name, has_streaming => 1); $node_standby_2->start; +# Wait until both standbys have connected to the primary +$node_primary->poll_query_until('postgres', + "SELECT count(*) = 2 FROM pg_stat_replication"); + # Create some content on primary $node_primary->safe_psql('postgres', "CREATE TABLE tab_int AS SELECT generate_series(1,1000) AS a"); -- 2.43.0