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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Fix pattern matching logic for logs in TAP tests of pgbench
Date: 2021-06-25 12:24:23
Message-ID: YNXK95K/Ewrg/1kb@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Fri, Jun 25, 2021 at 06:12:09AM -0400, Andrew Dunstan wrote:
> +        # On Msys, filter out any CRLF.
> +        $contents_raw =~ s/\r\n/\n/g if $Config{osname} eq 'msys';
>
> This is completely redundant. The whole point is that slurp_file does
> exactly this for you.

Thanks. I have managed to duplicate that.

> +        my @contents = split("\n", $contents_raw);
>
> Probably more idiomatic to write split(/\n/,$contents_raw), or
> split(/^/, $contents_raw) if you want to keep the line feeds.

I have gone with the solution that removes the newlines. This does
not change the pattern checks, and that makes printing entries not
matching a bit cleaner.

Thanks a lot for the investigation!
--
Michael

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-06-25 14:46:33 pgsql: Make walsenders show their replication commands in pg_stat_activ
Previous Message Michael Paquier 2021-06-25 11:16:47 pgsql: Cleanup some code related to pgbench log checks in TAP tests

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-06-25 12:33:25 Some incorrect logs in TAP tests of pgbench
Previous Message kuroda.hayato@fujitsu.com 2021-06-25 12:02:22 ECPG bug fix: DECALRE STATEMENT and DEALLOCATE, DESCRIBE