pgsql: Add PostgreSQL::Test::Cluster::read_head_tail() helper to Postgr - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Add PostgreSQL::Test::Cluster::read_head_tail() helper to Postgr
Date
Msg-id E1vRkrB-0033Db-27@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Add PostgreSQL::Test::Cluster::read_head_tail() helper to PostgreSQL/Utils.pm

This function reads the lines from a file and filters its contents to
report its head and tail contents.  The amount of contents to read from
a file can be tuned by the environment variable PG_TEST_FILE_READ_LINES,
that can be used to override the default of 50 lines.  If the file whose
content is read has less lines than two times PG_TEST_FILE_READ_LINES,
the whole file is returned.

This will be used in a follow-up commit to limit the amount of
information reported by some of the TAP tests on failure, where we have
noticed that the contents reported by the buildfarm can be heavily
bloated in some cases, with the head and tail contents of a report being
able to provide enough information to be useful for debugging.

Author: Nazir Bilal Yavuz <byavuz81@gmail.com>
Co-authored-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CAN55FZ1D6KXvjSs7YGsDeadqCxNF3UUhjRAfforzzP0k-cE=bA@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/regress.sgml              |  8 ++++++
src/test/perl/PostgreSQL/Test/Utils.pm | 50 ++++++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix text substring search for non-deterministic collations.
Next
From: Michael Paquier
Date:
Subject: pgsql: Improve error reporting of recovery test 027_stream_regress