From: Michael Paquier <michael@paquier.xyz>
To: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
Cc: Dmitry Koval <d.koval@postgrespro.ru>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #17288: PSQL bug with COPY command (Windows)
Date: Sun, 28 Nov 2021 13:15:36 +0900
Message-ID: <YaMCaDC7koHSrmzv@paquier.xyz> (raw)
In-Reply-To: <CAC+AXB346f7MWjW3HDpN8ATBKrUzcQEZDRzzpryziN-+Y3gNNQ@mail.gmail.com>
References: <9caa0612-19e5-f860-4b97-908a1c721233@postgrespro.ru>
<CAC+AXB1FTZueNdvT1F4fpr4z9gxpcKkgWa-Awor9XC9PAKLVSA@mail.gmail.com>
<YZiGIxk5F3TT/OJc@paquier.xyz>
<ff540eb5-3493-cf02-6c22-20ef6e15fee9@postgrespro.ru>
<CAC+AXB2GfM3NGjx7vc+=UvbD_bzQheiPqk2BQiFRn7G0oVUDhA@mail.gmail.com>
<c97531c7-a439-78b5-33e6-6aab5a900949@postgrespro.ru>
<YZ3Cm7PKGesAitYN@paquier.xyz>
<b108ffee-53b7-f11d-4110-1c2a72fa63b2@postgrespro.ru>
<YZ8BvVysOLJcTP16@paquier.xyz>
<CAC+AXB346f7MWjW3HDpN8ATBKrUzcQEZDRzzpryziN-+Y3gNNQ@mail.gmail.com>
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
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: michael@paquier.xyz, juanjo.santamaria@gmail.com, d.koval@postgrespro.ru, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17288: PSQL bug with COPY command (Windows)
In-Reply-To: <YaMCaDC7koHSrmzv@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox