pgsql: Fix pattern matching logic for logs in TAP tests of pgbench

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix pattern matching logic for logs in TAP tests of pgbench
Date: 2021-06-24 21:54:51
Message-ID: E1lwXJD-0005Kn-Jy@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c13585fe9e55813cf9feac67fe7b65d3a78fff92

Modified Files
--------------
src/bin/pgbench/t/001_pgbench_with_server.pl | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2021-06-24 22:06:23 Re: Ubuntu 14.04 (trusty) Postgres 13 deb package
Previous Message Bhavesh Mistry 2021-06-24 21:35:22 Ubuntu 14.04 (trusty) Postgres 13 deb package

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-06-24 22:25:55 Re: pgbench logging broken by time logic changes
Previous Message Bruce Momjian 2021-06-24 19:59:35 Re: Doc chapter for Hash Indexes