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

From Greg Sabino Mullane
Subject Re: psql's 001_basic.pl test could fail on very slow machines
Date
Msg-id CAKAnmmJG50u69OG1OejH3KHP2ujhdG3xcrFY1yNEJo8xGxkk_w@mail.gmail.com
Whole thread
In response to Re: psql's 001_basic.pl test could fail on very slow machines  (Oleg Tselebrovskiy <o.tselebrovskiy@postgrespro.ru>)
List pgsql-hackers
On Tue, Mar 10, 2026 at 7:01 AM Oleg Tselebrovskiy <o.tselebrovskiy@postgrespro.ru> wrote:
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

The test should still pass. I'm not worried about how many rows appear, just that they appear and then stop appearing once the criteria is met.
 
Maybe we could use sequences since we need a query that could self-terminate, like in attached?

Yes, I like this one better. +1

Inlining it here as it's so small:

CREATE SEQUENCE watch_test;

WITH x AS (SELECT nextval('watch_test') > 3 AS seq_limit_reached)
SELECT 123 FROM x WHERE NOT seq_limit_reached \watch i=0.2 m=1



Cheers,
Greg

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: finish TODOs in to_json_is_immutable, to_jsonb_is_immutable also add tests on it
Next
From: Jeff Davis
Date:
Subject: Re: [19] CREATE SUBSCRIPTION ... SERVER