Fix pattern matching logic for logs in TAP tests of pgbench

Michael Paquier <michael@paquier.xyz>

Commit: 7a9eaf111ac0a3ceba24fe15e5402bb2a17891f5
Author: Michael Paquier <michael@paquier.xyz>
Date: 2021-06-24T21:52:47Z
Releases: 13.4
Fix pattern matching logic for logs in TAP tests of pgbench

The logic checking for the format of per-thread logs used grep() with
directly "$re", which would cause the test to consider all the logs as
a match without caring about their format at all.  Using "/$re/" makes
grep() perform a regex test, which is what we want here.

While on it, improve some of the tests to be more picky with the
patterns expected and add more comments to describe the tests.

Issue discovered while digging into a separate patch.

Author: Fabien Coelho, Michael Paquier
Discussion: https://postgr.es/m/YNPsPAUoVDCpPOGk@paquier.xyz
Backpatch-through: 11

Files

PathChange+/−
src/bin/pgbench/t/001_pgbench_with_server.pl modified +14 −9

Discussion