From 114ae6240b1f35c31461228cc2af748bdf8813b9 Mon Sep 17 00:00:00 2001 From: Bryan Green Date: Sat, 8 Aug 2026 15:27:42 -0500 Subject: [PATCH] Avoid uninitialized-value error in poll_query_until timeout diagnostic PostgreSQL::Test::Cluster::poll_query_until() accepts an undefined query for connection-only checks; several recovery TAP tests call it as poll_query_until('postgres', undef, ''). On timeout it interpolates $query into the diag message, and because Cluster.pm runs under "use warnings FATAL => 'all'", interpolating the undefined value dies with "Use of uninitialized value" instead of printing the intended diagnostic, hiding the actual timeout. Use a fallback string when the query is undefined. Co-authored-by: Mark Dilger --- src/test/perl/PostgreSQL/Test/Cluster.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm index 3eae4cf628..9fec6b4e42 100644 --- a/src/test/perl/PostgreSQL/Test/Cluster.pm +++ b/src/test/perl/PostgreSQL/Test/Cluster.pm @@ -2808,8 +2808,9 @@ sub poll_query_until # Give up. Print the output from the last attempt, hopefully that's useful # for debugging. + my $msg_query = $query // '(undef - connection attempt only)'; diag qq(poll_query_until timed out executing this query: -$query +$msg_query expecting this output: $expected last actual query output: -- 2.49.0