pgsql: Add PostgreSQL::Test::Cluster::read_head_tail() helper to Postgr

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add PostgreSQL::Test::Cluster::read_head_tail() helper to Postgr
Date: 2025-12-06 05:29:22
Message-ID: E1vRkrB-0033Db-27@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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(at)gmail(dot)com>
Co-authored-by: Michael Paquier <michael(at)paquier(dot)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(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2025-12-06 05:44:14 pgsql: Improve error reporting of recovery test 027_stream_regress
Previous Message Tom Lane 2025-12-06 01:10:44 pgsql: Fix text substring search for non-deterministic collations.