Re: IPC::Run::time[r|out] vs our TAP tests

2025-02-20 Thread Daniel Gustafsson
> On 20 Feb 2025, at 14:06, Andrew Dunstan wrote: > Actually, since ok() and friends return true iff the test succeeds, instead of > +ok(! $self->{timeout}->is_expired, 'psql query_until did not time out'); > +return undef if $self->{timeout}->is_expired; > you can avoid doing the same te

Re: IPC::Run::time[r|out] vs our TAP tests

2025-02-20 Thread Andrew Dunstan
On 2025-02-19 We 6:56 PM, Daniel Gustafsson wrote: On 19 Feb 2025, at 23:08, Andrew Dunstan wrote: On 2024-10-31 Th 6:18 PM, Heikki Linnakangas wrote: Thanks for review! Perhaps sommething like this: "Close the psql session and clean up resources. Each psql session must be closed with C bef

Re: IPC::Run::time[r|out] vs our TAP tests

2025-02-19 Thread Daniel Gustafsson
> On 19 Feb 2025, at 23:08, Andrew Dunstan wrote: > On 2024-10-31 Th 6:18 PM, Heikki Linnakangas wrote: Thanks for review! >> Perhaps sommething like this: >> >> "Close the psql session and clean up resources. Each psql session must be >> closed with C before the end of the test. >> Returns TR

Re: IPC::Run::time[r|out] vs our TAP tests

2025-02-19 Thread Andrew Dunstan
On 2024-10-31 Th 6:18 PM, Heikki Linnakangas wrote: On 31/10/2024 14:27, Daniel Gustafsson wrote: On 28 Oct 2024, at 11:56, Heikki Linnakangas wrote: On 09/04/2024 20:10, Daniel Gustafsson wrote: =item $session->quit Close the session and clean up resources. Each test run must be closed wi

Re: IPC::Run::time[r|out] vs our TAP tests

2024-10-31 Thread Heikki Linnakangas
On 31/10/2024 14:27, Daniel Gustafsson wrote: On 28 Oct 2024, at 11:56, Heikki Linnakangas wrote: On 09/04/2024 20:10, Daniel Gustafsson wrote: =item $session->quit Close the session and clean up resources. Each test run must be closed with C. Returns TRUE when the session was cleanly termina

Re: IPC::Run::time[r|out] vs our TAP tests

2024-10-31 Thread Daniel Gustafsson
> On 28 Oct 2024, at 11:56, Heikki Linnakangas wrote: > > On 09/04/2024 20:10, Daniel Gustafsson wrote: >> Turning the timeout into a timer and returning undef along with logging a >> test >> failure in case of expiration seems a bit saner (maybe Andrew can suggest an >> API which has a better P

Re: IPC::Run::time[r|out] vs our TAP tests

2024-10-28 Thread Heikki Linnakangas
On 09/04/2024 20:10, Daniel Gustafsson wrote: Turning the timeout into a timer and returning undef along with logging a test failure in case of expiration seems a bit saner (maybe Andrew can suggest an API which has a better Perl feel to it). Most callsites don't need any changes to accommodate

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-09 Thread Daniel Gustafsson
> On 4 Apr 2024, at 23:46, Daniel Gustafsson wrote: > >> On 4 Apr 2024, at 23:24, Tom Lane wrote: > >> A minimum fix that seems to make this work better is as attached, >> but I feel like somebody ought to examine all the IPC::Run::timer >> and IPC::Run::timeout calls and see which ones are m

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-09 Thread Andrew Dunstan
On 2024-04-09 Tu 09:46, Tom Lane wrote: Michael Paquier writes: By the way, are you planning to do something like [1]? I've not looked in details at the callers of IPC::Run::timeout, still the extra debug output would be nice. It needs more review I think - I didn't check every call site to

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-09 Thread Tom Lane
Michael Paquier writes: > By the way, are you planning to do something like [1]? I've not > looked in details at the callers of IPC::Run::timeout, still the extra > debug output would be nice. It needs more review I think - I didn't check every call site to see if anything would be broken. I be

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-08 Thread Michael Paquier
On Fri, Apr 05, 2024 at 05:18:51PM -0400, Tom Lane wrote: > Based on this info, I'm disinclined to put work into trying to > make the case behave correctly with that old libedit version, or > even to lobotomize the test case enough so it would pass. By the way, are you planning to do something lik

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-05 Thread Michael Paquier
On Fri, Apr 05, 2024 at 05:18:51PM -0400, Tom Lane wrote: > What I suggest Michael do with tanager is install the > OS-version-appropriate version of GNU readline, so that the animal > will test what ilmari describes as the actually common use-case. Thanks for the investigations! It's clear that

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-05 Thread Tom Lane
=?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: > Tom Lane writes: >> So it seems like the bug does not exist in any currently-supported >> NetBSD release. Debian has been known to ship obsolete libedit >> versions, though. > Both the current (bokworm/12) and previous (bullseye/11) versions o

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-05 Thread Andrew Dunstan
On 2024-04-04 Th 17:24, Tom Lane wrote: TIL that IPC::Run::timer is not the same as IPC::Run::timeout. With a timer object you have to check $timer->is_expired to see if the timeout has elapsed, but with a timeout object you don't because it will throw a Perl exception upon timing out, probably

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-05 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > Erik Wienhold writes: >> Libedit 20191025-3.1 is the first version where ":{?VERB" works as >> expected. The previous release 20190324-3.1 still produces the escaped >> output that Michael found. That narrows down the changes to everything >> between [1] (changed on 2019-03-

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-04 Thread Tom Lane
Erik Wienhold writes: > Libedit 20191025-3.1 is the first version where ":{?VERB" works as > expected. The previous release 20190324-3.1 still produces the escaped > output that Michael found. That narrows down the changes to everything > between [1] (changed on 2019-03-24 but not included in 20

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-04 Thread Erik Wienhold
On 2024-04-05 05:37 +0200, Tom Lane wrote: > Erik Wienhold writes: > > I'm trying to build Postgres with that older libedit version but can't > > figure out what options to pass to ./configure so that it picks > > /usr/local/lib/libedit.so instead of /usr/lib/libedit.so. This didn't > > work: >

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-04 Thread Tom Lane
Erik Wienhold writes: > I'm trying to build Postgres with that older libedit version but can't > figure out what options to pass to ./configure so that it picks > /usr/local/lib/libedit.so instead of /usr/lib/libedit.so. This didn't > work: You probably want configure --with-libs=/usr/local/lib,

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-04 Thread Erik Wienhold
On 2024-04-05 05:10 +0200, Tom Lane wrote: > Erik Wienhold writes: > > It works with the latest libedit 20230828-3.1. Have to check the NetBSD > > source to find out what changed since 20181209-3.1. > > Yeah, the test is passing on mamba which is running the (just > officially released) NetBSD 1

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-04 Thread Tom Lane
Erik Wienhold writes: > It works with the latest libedit 20230828-3.1. Have to check the NetBSD > source to find out what changed since 20181209-3.1. Yeah, the test is passing on mamba which is running the (just officially released) NetBSD 10.0. I'm not sure whether 10.0 has the "latest" libedi

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-04 Thread Erik Wienhold
On 2024-04-05 04:37 +0200, Michael Paquier wrote: > On Thu, Apr 04, 2024 at 10:31:24PM -0400, Tom Lane wrote: > > Michael Paquier writes: > >> This stuff is actually kind of funny on this host, "\echo :{?VERB\t" > >> completes to something incorrect, as of: > >> postgres=# \echo :\{\?VERBOSITY\} >

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-04 Thread Michael Paquier
On Thu, Apr 04, 2024 at 10:31:24PM -0400, Tom Lane wrote: > Michael Paquier writes: >> This stuff is actually kind of funny on this host, "\echo :{?VERB\t" >> completes to something incorrect, as of: >> postgres=# \echo :\{\?VERBOSITY\} > > Just to be clear: you see the extra backslashes if you t

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-04 Thread Tom Lane
Michael Paquier writes: > On Thu, Apr 04, 2024 at 07:09:53PM -0400, Tom Lane wrote: >> If you have time, that'd be great. What I suspect is that that >> machine's readline isn't regurgitating the string verbatim but is >> doing something fancy with backspaces or other control characters. > I hav

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-04 Thread Michael Paquier
On Thu, Apr 04, 2024 at 07:09:53PM -0400, Tom Lane wrote: > If you have time, that'd be great. What I suspect is that that > machine's readline isn't regurgitating the string verbatim but is > doing something fancy with backspaces or other control characters. > But we need to see what it's actuall

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-04 Thread Tom Lane
Michael Paquier writes: > On Thu, Apr 04, 2024 at 05:24:05PM -0400, Tom Lane wrote: >> The particular thing that started me down this road was wondering >> why we are getting no useful failure details from buildfarm member >> tanager's struggles with the tab-completion test case added by commit >>

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-04 Thread Michael Paquier
On Thu, Apr 04, 2024 at 05:24:05PM -0400, Tom Lane wrote: > The particular thing that started me down this road was wondering > why we are getting no useful failure details from buildfarm member > tanager's struggles with the tab-completion test case added by commit > 927332b95 [1]. Also please no

Re: IPC::Run::time[r|out] vs our TAP tests

2024-04-04 Thread Daniel Gustafsson
> On 4 Apr 2024, at 23:24, Tom Lane wrote: > A minimum fix that seems to make this work better is as attached, > but I feel like somebody ought to examine all the IPC::Run::timer > and IPC::Run::timeout calls and see which ones are mistaken. > It's a little scary to convert a timeout to a timer b

IPC::Run::time[r|out] vs our TAP tests

2024-04-04 Thread Tom Lane
TIL that IPC::Run::timer is not the same as IPC::Run::timeout. With a timer object you have to check $timer->is_expired to see if the timeout has elapsed, but with a timeout object you don't because it will throw a Perl exception upon timing out, probably killing your test program. It appears that