[PATCH] Fix TAP tests with recent IPC::Run on Windows - Mailing list pgsql-hackers

From Andrew Bille
Subject [PATCH] Fix TAP tests with recent IPC::Run on Windows
Date
Msg-id CAJnzarxyuspsEcyG4iNqBQSVMj7B0mgZ3V4_EEhsKAhGtGX-Yg@mail.gmail.com
Whole thread
Responses Re: [PATCH] Fix TAP tests with recent IPC::Run on Windows
List pgsql-hackers
Hi,
While running the TAP test suite on Windows with IPC::Run 20260402.0,
I found a number of failures caused by changes in IPC::Run's Win32
stream handling.
There were two distinct symptoms.
First, IPC::Run now uses binary mode by default on Windows.  Text
captured into Perl scalars therefore retains CRLF, while a number of
TAP tests expect the previous text-mode behavior.  This caused many
comparisons to fail even though the displayed output looked identical.
The patch adds ipc_run_text_mode() and uses it for IPC::Run redirects
whose contents are treated as text by the tests.
Second, a few tests relied on implicit standard streams.  With the
recent IPC::Run this resulted in failures such as:

psql: error: could not print result table: Bad file descriptor

and, in pg_upgrade tests, child xcopy commands failing to copy
pg_xact unless stdin was supplied explicitly.
Those cases now use explicit stream endpoints.
I tested the patch with the full test suite on Windows using both:
IPC::Run 20260402.0
IPC::Run 20231003.0
Both pass.  I also tested the changes on Linux successfully.
Patch attached.

Regards,
Andrew, Postgres Professional

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: WAL segment file descriptor leak on read errors can PANIC the server
Next
From: Michael Paquier
Date:
Subject: Re: BUG: pg_class.relchecks overflow, making table undroppable