summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-10-16 12:27:14 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-10-16 12:27:39 -0400
commit0ed4a47fbfbd0f22806dc14f70dcc42de07ce9f1 (patch)
treee78813ac397cdf2a48062f62dc4de36ce77dca65 /src
parent3e406417b8da9fe7139374f35cab5f9d55881760 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/test/perl/PostgresNode.pm15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index 8ec843edeaa..b1cd0c07afc 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -1239,9 +1239,18 @@ sub poll_query_until
$attempts++;
}
- # The query result didn't change in 180 seconds. Give up. Print the stderr
- # from the last attempt, hopefully that's useful for debugging.
- diag $stderr;
+ # The query result didn't change in 180 seconds. Give up. Print the
+ # output from the last attempt, hopefully that's useful for debugging.
+ chomp($stderr);
+ $stderr =~ s/\r//g if $TestLib::windows_os;
+ diag qq(poll_query_until timed out executing this query:
+$query
+expecting this output:
+$expected
+last actual query output:
+$stdout
+with stderr:
+$stderr);
return 0;
}