pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Refactor routine to find single log content pattern in TAP tests 6+ messages / 1 participants [nested] [flat]
* pgsql: Refactor routine to find single log content pattern in TAP tests @ 2023-06-09 02:57 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2023-06-09 02:57 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Refactor routine to find single log content pattern in TAP tests The same routine to check if a specific pattern can be found in the server logs was copied over four different test scripts. This refactors the whole to use a single routine located in PostgreSQL::Test::Cluster, named log_contains, to grab the contents of the server logs and check for a specific pattern. On HEAD, the code previously used assumed that slurp_file() could not handle an undefined offset, setting it to zero, but slurp_file() does do an extra fseek() before retrieving the log contents only if an offset is defined. In two places, the test was retrieving the full log contents with slurp_file() after calling substr() to apply an offset, ignoring that slurp_file() would be able to handle that. Backpatch all the way down to ease the introduction of new tests that could rely on the new routine. Author: Vignesh C Reviewed-by: Andrew Dunstan, Dagfinn Ilmari Mannsåker, Michael Paquier Discussion: https://postgr.es/m/CALDaNm0YSiLpjCmajwLfidQrFOrLNKPQir7s__PeVvh9U3uoTQ@mail.gmail.com Backpatch-through: 11 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/392ea0c78fdb6cb92f1af0793f6c2d48526e6fed Modified Files -------------- src/test/authentication/t/003_peer.pl | 17 ++--------- src/test/perl/PostgreSQL/Test/Cluster.pm | 16 ++++++++++ src/test/recovery/t/019_replslot_limit.pl | 35 +++++----------------- src/test/recovery/t/033_replay_tsp_drops.pl | 13 +------- .../recovery/t/035_standby_logical_decoding.pl | 26 +++------------- 5 files changed, 32 insertions(+), 75 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Refactor routine to find single log content pattern in TAP tests @ 2023-06-09 02:57 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2023-06-09 02:57 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Refactor routine to find single log content pattern in TAP tests The same routine to check if a specific pattern can be found in the server logs was copied over four different test scripts. This refactors the whole to use a single routine located in PostgreSQL::Test::Cluster, named log_contains, to grab the contents of the server logs and check for a specific pattern. On HEAD, the code previously used assumed that slurp_file() could not handle an undefined offset, setting it to zero, but slurp_file() does do an extra fseek() before retrieving the log contents only if an offset is defined. In two places, the test was retrieving the full log contents with slurp_file() after calling substr() to apply an offset, ignoring that slurp_file() would be able to handle that. Backpatch all the way down to ease the introduction of new tests that could rely on the new routine. Author: Vignesh C Reviewed-by: Andrew Dunstan, Dagfinn Ilmari Mannsåker, Michael Paquier Discussion: https://postgr.es/m/CALDaNm0YSiLpjCmajwLfidQrFOrLNKPQir7s__PeVvh9U3uoTQ@mail.gmail.com Backpatch-through: 11 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e25e5f7fc6b74c9d4ce82627e9145ef5537412e2 Modified Files -------------- src/test/perl/PostgreSQL/Test/Cluster.pm | 15 ++++++++++++++ src/test/recovery/t/019_replslot_limit.pl | 31 ++++++----------------------- src/test/recovery/t/033_replay_tsp_drops.pl | 14 ++----------- 3 files changed, 23 insertions(+), 37 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Refactor routine to find single log content pattern in TAP tests @ 2023-06-09 02:57 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2023-06-09 02:57 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Refactor routine to find single log content pattern in TAP tests The same routine to check if a specific pattern can be found in the server logs was copied over four different test scripts. This refactors the whole to use a single routine located in PostgreSQL::Test::Cluster, named log_contains, to grab the contents of the server logs and check for a specific pattern. On HEAD, the code previously used assumed that slurp_file() could not handle an undefined offset, setting it to zero, but slurp_file() does do an extra fseek() before retrieving the log contents only if an offset is defined. In two places, the test was retrieving the full log contents with slurp_file() after calling substr() to apply an offset, ignoring that slurp_file() would be able to handle that. Backpatch all the way down to ease the introduction of new tests that could rely on the new routine. Author: Vignesh C Reviewed-by: Andrew Dunstan, Dagfinn Ilmari Mannsåker, Michael Paquier Discussion: https://postgr.es/m/CALDaNm0YSiLpjCmajwLfidQrFOrLNKPQir7s__PeVvh9U3uoTQ@mail.gmail.com Backpatch-through: 11 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/28af91b4e79763c810c01efaafbfd10740fd5990 Modified Files -------------- src/test/perl/PostgresNode.pm | 15 ++++++++++++++ src/test/recovery/t/019_replslot_limit.pl | 31 ++++++----------------------- src/test/recovery/t/033_replay_tsp_drops.pl | 14 ++----------- 3 files changed, 23 insertions(+), 37 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Refactor routine to find single log content pattern in TAP tests @ 2023-06-09 02:57 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2023-06-09 02:57 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Refactor routine to find single log content pattern in TAP tests The same routine to check if a specific pattern can be found in the server logs was copied over four different test scripts. This refactors the whole to use a single routine located in PostgreSQL::Test::Cluster, named log_contains, to grab the contents of the server logs and check for a specific pattern. On HEAD, the code previously used assumed that slurp_file() could not handle an undefined offset, setting it to zero, but slurp_file() does do an extra fseek() before retrieving the log contents only if an offset is defined. In two places, the test was retrieving the full log contents with slurp_file() after calling substr() to apply an offset, ignoring that slurp_file() would be able to handle that. Backpatch all the way down to ease the introduction of new tests that could rely on the new routine. Author: Vignesh C Reviewed-by: Andrew Dunstan, Dagfinn Ilmari Mannsåker, Michael Paquier Discussion: https://postgr.es/m/CALDaNm0YSiLpjCmajwLfidQrFOrLNKPQir7s__PeVvh9U3uoTQ@mail.gmail.com Backpatch-through: 11 Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a9231fedae7a840433bb8eacc211b8e2b5f8893e Modified Files -------------- src/test/perl/PostgresNode.pm | 15 +++++++++++++++ src/test/recovery/t/019_replslot_limit.pl | 25 ++++--------------------- src/test/recovery/t/033_replay_tsp_drops.pl | 14 ++------------ 3 files changed, 21 insertions(+), 33 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Refactor routine to find single log content pattern in TAP tests @ 2023-06-09 02:57 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2023-06-09 02:57 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Refactor routine to find single log content pattern in TAP tests The same routine to check if a specific pattern can be found in the server logs was copied over four different test scripts. This refactors the whole to use a single routine located in PostgreSQL::Test::Cluster, named log_contains, to grab the contents of the server logs and check for a specific pattern. On HEAD, the code previously used assumed that slurp_file() could not handle an undefined offset, setting it to zero, but slurp_file() does do an extra fseek() before retrieving the log contents only if an offset is defined. In two places, the test was retrieving the full log contents with slurp_file() after calling substr() to apply an offset, ignoring that slurp_file() would be able to handle that. Backpatch all the way down to ease the introduction of new tests that could rely on the new routine. Author: Vignesh C Reviewed-by: Andrew Dunstan, Dagfinn Ilmari Mannsåker, Michael Paquier Discussion: https://postgr.es/m/CALDaNm0YSiLpjCmajwLfidQrFOrLNKPQir7s__PeVvh9U3uoTQ@mail.gmail.com Backpatch-through: 11 Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3509a060d7311b7f9904e011fd9574732a8c81b2 Modified Files -------------- src/test/perl/PostgresNode.pm | 15 +++++++++++++++ src/test/recovery/t/033_replay_tsp_drops.pl | 14 ++------------ 2 files changed, 17 insertions(+), 12 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Refactor routine to find single log content pattern in TAP tests @ 2023-06-09 02:57 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 6+ messages in thread From: Michael Paquier @ 2023-06-09 02:57 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Refactor routine to find single log content pattern in TAP tests The same routine to check if a specific pattern can be found in the server logs was copied over four different test scripts. This refactors the whole to use a single routine located in PostgreSQL::Test::Cluster, named log_contains, to grab the contents of the server logs and check for a specific pattern. On HEAD, the code previously used assumed that slurp_file() could not handle an undefined offset, setting it to zero, but slurp_file() does do an extra fseek() before retrieving the log contents only if an offset is defined. In two places, the test was retrieving the full log contents with slurp_file() after calling substr() to apply an offset, ignoring that slurp_file() would be able to handle that. Backpatch all the way down to ease the introduction of new tests that could rely on the new routine. Author: Vignesh C Reviewed-by: Andrew Dunstan, Dagfinn Ilmari Mannsåker, Michael Paquier Discussion: https://postgr.es/m/CALDaNm0YSiLpjCmajwLfidQrFOrLNKPQir7s__PeVvh9U3uoTQ@mail.gmail.com Backpatch-through: 11 Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ced4cc30d5decf504c7b2f2fd4b80eda24d72e1e Modified Files -------------- src/test/perl/PostgresNode.pm | 15 +++++++++++++++ src/test/recovery/t/033_replay_tsp_drops.pl | 14 ++------------ 2 files changed, 17 insertions(+), 12 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2023-06-09 02:57 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-06-09 02:57 pgsql: Refactor routine to find single log content pattern in TAP tests Michael Paquier <michael@paquier.xyz> 2023-06-09 02:57 pgsql: Refactor routine to find single log content pattern in TAP tests Michael Paquier <michael@paquier.xyz> 2023-06-09 02:57 pgsql: Refactor routine to find single log content pattern in TAP tests Michael Paquier <michael@paquier.xyz> 2023-06-09 02:57 pgsql: Refactor routine to find single log content pattern in TAP tests Michael Paquier <michael@paquier.xyz> 2023-06-09 02:57 pgsql: Refactor routine to find single log content pattern in TAP tests Michael Paquier <michael@paquier.xyz> 2023-06-09 02:57 pgsql: Refactor routine to find single log content pattern in TAP tests Michael Paquier <michael@paquier.xyz>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox