Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0ed4a47

Browse files
committed
Make PostgresNode.pm's poll_query_until() more chatty about failures.
Reporting only the stderr is unhelpful when the problem is that the server output we're getting doesn't match what was expected. So we should report the query output too; and just for good measure, let's print the query we used and the output we expected. Back-patch to 9.5 where poll_query_until was introduced. Discussion: https://postgr.es/m/17913.1539634756@sss.pgh.pa.us
1 parent 3e40641 commit 0ed4a47

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/test/perl/PostgresNode.pm

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,9 +1239,18 @@ sub poll_query_until
12391239
$attempts++;
12401240
}
12411241

1242-
# The query result didn't change in 180 seconds. Give up. Print the stderr
1243-
# from the last attempt, hopefully that's useful for debugging.
1244-
diag $stderr;
1242+
# The query result didn't change in 180 seconds. Give up. Print the
1243+
# output from the last attempt, hopefully that's useful for debugging.
1244+
chomp($stderr);
1245+
$stderr =~ s/\r//g if $TestLib::windows_os;
1246+
diag qq(poll_query_until timed out executing this query:
1247+
$query
1248+
expecting this output:
1249+
$expected
1250+
last actual query output:
1251+
$stdout
1252+
with stderr:
1253+
$stderr);
12451254
return 0;
12461255
}
12471256

0 commit comments

Comments
 (0)