Re: Implement generalized sub routine find_in_log for tap test
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: vignesh C <vignesh21@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-06-03T22:21:27Z
Lists: pgsql-hackers
Attachments
- v4-0001-Remove-duplicate-find_in_log-sub-routines-from-ta.patch (text/plain) patch v4-0001
- v4-0002-Move-common-connection-log-content-verification-c.patch (text/plain) patch v4-0002
- v4-0003-Adjust-a-bit-previous-patches.patch (text/plain) patch v4-0003
On Mon, May 29, 2023 at 07:49:52AM +0530, vignesh C wrote: > Thanks for the comment, the attached v3 version patch has the changes > for the same. -if (find_in_log( - $node, $log_offset, - qr/peer authentication is not supported on this platform/)) +if ($node->log_contains( + qr/peer authentication is not supported on this platform/), + $log_offset,) This looks like a typo to me, the log offset is eaten. Except of that, I am on board with log_contains(). There are two things that bugged me with the refactoring related to connect_ok and connect_fails: - check_connect_log_contents() is a name too complicated. While looking at that I have settled to a simpler log_check(), as we could perfectly use that for something else than connections as long as we want to check multiple patterns at once. - The refactoring of the documentation for the routines of Cluster.pm became incorrect. For example, the patch does not list anymore log_like and log_unlike for connect_ok. With all that in mind I have hacked a few adjustments in a 0003, though I agree with the separation between 0001 and 0002. 033_replay_tsp_drops and 019_replslot_limit are not new to v16, but 003_peer.pl and 035_standby_logical_decoding.pl, making the number of places where find_in_log() exists twice as much. So I would be tempted to refactor these tests in v16. Perhaps anybody from the RMT could comment? We've usually been quite flexible with the tests even in beta. Thoughts? -- Michael
Commits
-
Refactor routine to find single log content pattern in TAP tests
- ced4cc30d5de 11.21 landed
- 3509a060d731 12.16 landed
- a9231fedae7a 13.12 landed
- 28af91b4e797 14.9 landed
- e25e5f7fc6b7 15.4 landed
- 392ea0c78fdb 16.0 landed
-
Refactor log check logic for connect_ok/fails in PostgreSQL::Test::Cluster
- 30469a6ed424 14.9 landed
- 7fa7911c7675 15.4 landed
- 26eaf82e7138 16.0 landed