Commit 87b2124d authored by Michael Paquier's avatar Michael Paquier

Add more debugging information with log checks in TAP tests of pgbench

fairywren is not happy with the pattern checks introduced by c13585fe.
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
parent 797b0fc0
...@@ -1199,8 +1199,18 @@ sub check_pgbench_logs ...@@ -1199,8 +1199,18 @@ sub check_pgbench_logs
my $clen = @contents; my $clen = @contents;
ok( $min <= $clen && $clen <= $max, ok( $min <= $clen && $clen <= $max,
"transaction count for $log ($clen)"); "transaction count for $log ($clen)");
ok( grep(/$re/, @contents) == $clen, my $clen_match = grep(/$re/, @contents);
"transaction format for $prefix"); 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 "$@"; close $fh or die "$@";
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment