pgsql: Refactor routine to find single log content pattern in TAP tests

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема pgsql: Refactor routine to find single log content pattern in TAP tests
Дата
Msg-id E1q7SJU-000rWB-B3@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: pgsql: Refactor routine to find single log content pattern in TAP tests
Следующее
От: Nathan Bossart
Дата:
Сообщение: pgsql: Fix missing word in nbtree/README.