Re: Improve error reporting in 027_stream_regress test

Nazir Bilal Yavuz <byavuz81@gmail.com>

From: Nazir Bilal Yavuz <byavuz81@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Andres Freund <andres@anarazel.de>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-07-29T06:33:22Z
Lists: pgsql-hackers
Hi,

On Tue, 29 Jul 2025 at 04:46, Michael Paquier <michael@paquier.xyz> wrote:
>
> > - 0002 is the actual patch that improves error reporting in the
> > 027_stream_regress test by using the read_file_ends() function. It
> > adds a regression_log_helper() function, which reads the
> > PG_TEST_FILE_READ_LINES environment variable and then calls
> > read_file_ends() with force_line_count set to true. This approach
> > avoids any potential race condition where the environment variable
> > might be modified after being read in the regression_log_helper() and
> > before used in the read_file_ends().
>
> Why do you think the environment variable could be changed mid-flight
> in the context of a single test run?

I mean it is a run-time variable, so it is up to the user. The timing
between these two operations are extremely tight, so it is very
unlikely but not impossible. Do you think this edge case is not worth
accounting for?

-- 
Regards,
Nazir Bilal Yavuz
Microsoft



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Improve error reporting of recovery test 027_stream_regress

  2. Add PostgreSQL::Test::Cluster::read_head_tail() helper to PostgreSQL/Utils.pm

  3. Handle timeout in PostgreSQL::Test::Cluster::is_alive()

  4. Check status of nodes after regression test run in 027_stream_regress

  5. Add PostgreSQL::Test::Cluster::is_alive()