Re: Improve error reporting in 027_stream_regress test

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Bilal Yavuz <byavuz81(at)gmail(dot)com>
Cc: Brandon Tat <brandontat6(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alexander Lakhin <exclusion(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Improve error reporting in 027_stream_regress test
Date: 2025-12-05 04:36:56
Message-ID: aTJhaKQRHbmiDmSU@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 04, 2025 at 03:33:30PM +0300, Bilal Yavuz wrote:
> I applied these feedbacks in v5. I wanted to cover all possible cases
> so I think 0002 might be a bit more complicated than it needs to be.
>
> What do you think about the current implementation?

I'm finding that a bit bloated. My own attempt is the attached, which
is much simpler, returning only array for the lines of @tail and
@head. I am not sure to see the use-case in favor of enforcing the
line count for the caller of the new routine based on what's on this
thread, so I have left that out to simplify the patch.

v5 had a mistake: slurp_file() on the full diffs should be removed
once we dump only the tail and head. It is true that 027 would add an
extra line if regression.diffs is too short when written this way, but
the information reported is the same, while keeping the code simpler
in 027. A portion of the comment at the top of the block printing the
diffs could be removed: with the limitation of lines in place we don't
bloat the output anymore.
--
Michael

Attachment Content-Type Size
v6-0001-Add-read_head_tail-helper-to-Utils.pm.patch text/x-diff 3.1 KB
v6-0002-Improve-error-reporting-in-027_stream_regress-tes.patch text/x-diff 2.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Donghang Lin 2025-12-05 04:43:12 Re: bt_index_parent_check and concurrently build indexes
Previous Message Shinya Kato 2025-12-05 04:29:54 Re: Add mode column to pg_stat_progress_vacuum