Skip to content

Commit 87b2124

Browse files
committed
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
1 parent 797b0fc commit 87b2124

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/bin/pgbench/t/001_pgbench_with_server.pl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,8 +1199,18 @@ sub check_pgbench_logs
11991199
my $clen = @contents;
12001200
ok( $min <= $clen && $clen <= $max,
12011201
"transaction count for $log ($clen)");
1202-
ok( grep(/$re/, @contents) == $clen,
1203-
"transaction format for $prefix");
1202+
my $clen_match = grep(/$re/, @contents);
1203+
ok($clen_match == $clen, "transaction format for $prefix");
1204+
# Show more information if some logs don't match
1205+
# to help with debugging.
1206+
if ($clen_match != $clen)
1207+
{
1208+
foreach my $log (@contents)
1209+
{
1210+
print "# Log entry not matching: $log\n"
1211+
unless $log =~ /$re/;
1212+
}
1213+
}
12041214
close $fh or die "$@";
12051215
};
12061216
}

0 commit comments

Comments
 (0)