Re: psql's 001_basic.pl test could fail on very slow machines

From: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
To: Oleg Tselebrovskiy <o(dot)tselebrovskiy(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql's 001_basic.pl test could fail on very slow machines
Date: 2026-03-10 14:23:21
Message-ID: CAKAnmmJG50u69OG1OejH3KHP2ujhdG3xcrFY1yNEJo8xGxkk_w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 10, 2026 at 7:01 AM Oleg Tselebrovskiy <
o(dot)tselebrovskiy(at)postgrespro(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2026-03-10 14:23:46 Re: [19] CREATE SUBSCRIPTION ... SERVER
Previous Message Andrew Dunstan 2026-03-10 14:12:39 Re: finish TODOs in to_json_is_immutable, to_jsonb_is_immutable also add tests on it