Re: BUG #17288: PSQL bug with COPY command (Windows) - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #17288: PSQL bug with COPY command (Windows)
Date
Msg-id YaMCaDC7koHSrmzv@paquier.xyz
Whole thread Raw
In response to Re: BUG #17288: PSQL bug with COPY command (Windows)  (Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>)
Responses Re: BUG #17288: PSQL bug with COPY command (Windows)
List pgsql-bugs
On Fri, Nov 26, 2021 at 01:37:49PM +0100, Juan José Santamaría Flecha wrote:
> through a tap test using console input. Looking at the patch I'm not sure
> it is worth all the extra code, but I'm submitting it for future reference
> at least.

+       eval {
+               $result = IPC::Run::run [ 'psql', '-p', $port, '-c',
"\\copy public.test from stdin", 'postgres' ],
+                       IPC::Run::timeout( 1, name => "stall timeout" );
Using directly psql commands in the tests is not a good idea as it
makes the client-side execution more sensitive to the environment.
src/test/perl/PostgreSQL/Test/Cluster.pm does the same work, in the
wanted way, so it would be better to rely on it (see 384f1ab for one
recent issue).  A test with a minimal timeout also takes time, making
for slower tests on faster machines.

Hmm.  Do you think that a test based on Cluster::psql and stdout would
actually be able to do the work or would the redirection done in the
INIT block of Utils.pm prevent that?  Contrary to the code path of
pg_recvlogical, Cluster::psql would use directly IPC::Run, and not
redirect stdout to the test log file.

I would stick a test in one of the existing test suites, to not create
an extra cluster and reduce its run time.
--
Michael

Attachment

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17301: SELECT gets weird result while two transactions are submitted concurrently
Next
From: Michael Paquier
Date:
Subject: Re: BUG #17288: PSQL bug with COPY command (Windows)