postgres.git / summary / log / commit / refs
commit 37c4a0730f8e9230b8e15a33ec5ebd4dae24ca96
Author: Michael Paquier <michael@paquier.xyz>
Date: Wed Aug 12 07:23:17 2026 +0000
Fix poll_query_until() timeout handling with an undefined query in Cluster.pm
On timeout, poll_query_until() would fail to print its report when
"$query" was undefined. Instead of the expected report, this prevented
the contents of stdout and stderr from being shown.
Note that some of the in-core tests use an undefined query for
connection-only polls.
Author: Bryan Green <dbryan.green@gmail.com>
Reviewed-by: Jonathan Gonzalez V. <jonathan.abdiel@gmail.com>
Discussion: https://postgr.es/m/0f515c6d-6032-4c5f-80ac-5c78faae9522@gmail.com
Backpatch-through: 14
src/test/perl/PostgreSQL/Test/Cluster.pm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm
index cdc247e559a..31d9d7350ac 100644
--- a/src/test/perl/PostgreSQL/Test/Cluster.pm
+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm
@@ -2448,8 +2448,10 @@ sub poll_query_until
# Give up. Print the output from the last attempt, hopefully that's useful
# for debugging.
+ my $msg_query = $query;
+ $msg_query = '(connection attempt only)' unless defined $query;
diag qq(poll_query_until timed out executing this query:
-$query
+$msg_query
expecting this output:
$expected
last actual query output:
[parent: 61d1f7a20a36]