Re: Make psql's qeury canceling test simple by using signal() routine of IPC::Run

From: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
To: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Make psql's qeury canceling test simple by using signal() routine of IPC::Run
Date: 2023-09-05 15:45:24
Message-ID: 20230906004524.2fd6ee049f8a6c6f2690b99c@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 14 Aug 2023 23:37:25 +0900
Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp> wrote:

> On Mon, 14 Aug 2023 08:29:25 +0900
> Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> > On Sun, Aug 13, 2023 at 11:22:33AM +0200, Fabien COELHO wrote:
> > > Test run is ok on my Ubuntu laptop.
> >
> > I have a few comments about this patch.
> >
> > On HEAD and even after this patch, we still have the following:
> > SKIP: { skip "cancel test requires a Unix shell", 2 if $windows_os;
> >
> > Could the SKIP be removed for $windows_os? If not, this had better be
> > documented because the reason for the skip becomes incorrect.
> >
> > The comment at the top of the SKIP block still states the following:
> > # There is, as of this writing, no documented way to get the PID of
> > # the process from IPC::Run. As a workaround, we have psql print its
> > # own PID (which is the parent of the shell launched by psql) to a
> > # file.
> >
> > This is also incorrect.
>
> Thank you for your comments
>
> I will check whether the test works in Windows and remove SKIP if possible.
> Also, I'll fix the comment in either case.

I checked if the test using IPC::Run::signal can work on Windows, and
confirmed that this didn't work because sending SIGINT caused to
terminate the test itself. Here is the results;

t/001_basic.pl ........... ok
t/010_tab_completion.pl .. skipped: readline is not supported by this build
t/020_cancel.pl .......... Terminating on signal SIGINT(2)

Therefore, this test should be skipped on Windows.

I attached the update patch. I removed the incorrect comments and
unnecessary lines. Also, I rewrote the test to use "skip_all" instead
of SKIP because we skip the whole test rather than a part of it.

Regards,
Yugo Nagata

>
> Regards,
> Yugo Nagata
>
> --
> Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
>
>

--
Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>

Attachment Content-Type Size
v2_simple_psql_cancel_test.patch text/x-diff 3.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2023-09-05 16:01:09 Re: A minor adjustment to get_cheapest_path_for_pathkeys
Previous Message Alvaro Herrera 2023-09-05 15:29:56 Re: cataloguing NOT NULL constraints