From: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow TestLib::slurp_file to skip contents, and use as needed
Date: Fri, 16 Apr 2021 21:42:14 +0000
Message-ID: <E1lXWEA-0003PW-5J@gemulon.postgresql.org> (raw)
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_11_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/4c9298130ae8d4f3ba4149fbda3b95f6c86258d9
Modified Files
--------------
src/test/perl/PostgresNode.pm | 8 +++-----
src/test/perl/TestLib.pm | 16 +++++++++++++---
2 files changed, 16 insertions(+), 8 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: andrew@dunslane.net
Subject: Re: pgsql: Allow TestLib::slurp_file to skip contents, and use as needed
In-Reply-To: <E1lXWEA-0003PW-5J@gemulon.postgresql.org>
References: <E1lXWEA-0003PW-5J@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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