pgsql: Allow TestLib::slurp_file to skip contents, and use as needed - Mailing list pgsql-committers

From Andrew Dunstan
Subject pgsql: Allow TestLib::slurp_file to skip contents, and use as needed
Date
Msg-id E1lXWEA-0003PY-5f@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Allow TestLib::slurp_file to skip contents, and use as needed

In order to avoid getting old logfile contents certain functions in
PostgresNode were doing one of two things. On Windows it rotated the
logfile and restarted the server, while elsewhere it truncated the log
file. Both of these are unnecessary. We borrow from the buildfarm which
does this instead: note the size of the logfile before we start, and
then when fetching the logfile skip to that position before accumulating
contents. This is spelled differently on Windows but the effect is the
same. This is largely centralized in TestLib's slurp_file function,
which has a new optional parameter, the offset to skip to before
starting to reading the file. Code in the client becomes much neater.

Backpatch to all live branches.

Michael Paquier, slightly modified by me.

Discussion: https://postgr.es/m/YHajnhcMAI3++pJL@paquier.xyz

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f8ba416a98ceded2f97bd3aaa06b081c216ac4d7

Modified Files
--------------
src/test/perl/PostgresNode.pm |  8 +++-----
src/test/perl/TestLib.pm      | 15 +++++++++++++--
2 files changed, 16 insertions(+), 7 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Use SIGURG rather than SIGUSR1 for latches.
Next
From: Tom Lane
Date:
Subject: pgsql: Convert built-in SQL-language functions to SQL-standard-body sty