Re: psql's 001_basic.pl test could fail on very slow machines - Mailing list pgsql-hackers

From Oleg Tselebrovskiy
Subject Re: psql's 001_basic.pl test could fail on very slow machines
Date
Msg-id bd9cab9439d724f935c41f6207809542@postgrespro.ru
Whole thread Raw
In response to Re: psql's 001_basic.pl test could fail on very slow machines  (Greg Sabino Mullane <htamfids@gmail.com>)
Responses Re: psql's 001_basic.pl test could fail on very slow machines
List pgsql-hackers
Greg Sabino Mullane wrote at 2026-03-09 22:07:
> I don't think your new test is really testing the full functionality
> of \watch min, but I agree that existing test does not either. How
> about something like this?
> 
> select now() as start \gset
> with x as (select now() - :'start' as howlong)
> select 123 from x where howlong < '0.5 second' \watch i=0.2 m=1

Yeah, your query fits the spirit of the test more and doesn't fail
with modified post_auth_delay. We would expect 3 rows with
this wait interval and '0.5 second' limit, but on really slow
machines we could wait more than 0.2 seconds between watches and
the test would still fail

Maybe we could use sequences since we need a query that could
self-terminate, like in attached?

Regards,
Oleg
Attachment

pgsql-hackers by date:

Previous
From: "Anders Åstrand"
Date:
Subject: Re: Potential security risk associated with function call
Next
From: Ranier Vilela
Date:
Subject: Re: Simplifies checks (src/bin/pg_dump/pg_backup_archiver.c)