Re: pgsql: Fix pattern matching logic for logs in TAP tests of pgbench
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: pgsql-committers@lists.postgresql.org
Date: 2021-06-25T12:24:23Z
Lists: 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
Commits
-
Cleanup some code related to pgbench log checks in TAP tests
- c4c9c77e56e7 11.13 landed
- 79c24a0c21c4 12.8 landed
- af2e67b47afe 13.4 landed
- 38ff135d9466 14.0 landed
-
Add more debugging information with log checks in TAP tests of pgbench
- 87b2124dfa07 14.0 landed
-
Fix pattern matching logic for logs in TAP tests of pgbench
- c13585fe9e55 14.0 cited