aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2021-06-25 09:56:44 +0900
committerMichael Paquier <michael@paquier.xyz>2021-06-25 09:56:44 +0900
commit87b2124dfa0782a697ea7b90aff15a6f6117a720 (patch)
tree235a0b0e325e72183d4db91ae25f2b3643937a2b /src
parent797b0fc0b078c7b4c46ef9f2d9e47aa2d98c6c63 (diff)
downloadpostgresql-87b2124dfa0782a697ea7b90aff15a6f6117a720.tar.gz
postgresql-87b2124dfa0782a697ea7b90aff15a6f6117a720.zip
Add more debugging information with log checks in TAP tests of pgbench
fairywren is not happy with the pattern checks introduced by c13585f. I am not sure if this outlines a bug in pgbench or if the regex patterns used in the tests are too restrictive for this buildfarm member's environment. This adds more debugging information to show the log entries that do not match with the expected pattern, to help in finding out what's happening. That seems like a good addition in the long-term anyway as that may not be the only issue in this area. Discussion: https://postgr.es/m/YNUad2HvgW+6eXyo@paquier.xyz
Diffstat (limited to 'src')
-rw-r--r--src/bin/pgbench/t/001_pgbench_with_server.pl14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/bin/pgbench/t/001_pgbench_with_server.pl b/src/bin/pgbench/t/001_pgbench_with_server.pl
index 0cf80aba972..ff5b31d4df1 100644
--- a/src/bin/pgbench/t/001_pgbench_with_server.pl
+++ b/src/bin/pgbench/t/001_pgbench_with_server.pl
@@ -1199,8 +1199,18 @@ sub check_pgbench_logs
my $clen = @contents;
ok( $min <= $clen && $clen <= $max,
"transaction count for $log ($clen)");
- ok( grep(/$re/, @contents) == $clen,
- "transaction format for $prefix");
+ my $clen_match = grep(/$re/, @contents);
+ ok($clen_match == $clen, "transaction format for $prefix");
+ # Show more information if some logs don't match
+ # to help with debugging.
+ if ($clen_match != $clen)
+ {
+ foreach my $log (@contents)
+ {
+ print "# Log entry not matching: $log\n"
+ unless $log =~ /$re/;
+ }
+ }
close $fh or die "$@";
};
}