Re: IPC::Run::time[r|out] vs our TAP tests
Daniel Gustafsson <daniel@yesql.se>
From: Daniel Gustafsson <daniel@yesql.se>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Tom Lane <tgl@sss.pgh.pa.us>
Date: 2025-02-20T14:09:58Z
Lists: pgsql-hackers
Attachments
- v4-0002-Report-test-failure-rather-than-aborting-in-case-.patch (application/octet-stream) patch v4-0002
- v4-0001-Configure-interactive-instance-to-restart-timer.patch (application/octet-stream) patch v4-0001
> On 20 Feb 2025, at 14:06, Andrew Dunstan <andrew@dunslane.net> 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 test twice and say:
> ok(! $self->{timeout}->is_expired, 'psql query_until did not time out') || return undef;
> although for slightly technical reasons perlcritic disapproves of "return undef" and prefers that you just write a bare "return" so we should also fix that.
> Sorry for taking a second bite at the cherry.
Not at all, I agree that this is an improvement so fixed in the attached along
with a fresh pgperltidy.
--
Daniel Gustafsson
Commits
-
Restart BackgroundPsql's timer more nicely.
- 53c6bd0aa3de 19 (unreleased) landed
-
Implement pg_wal_replay_wait() stored procedure
- 3c5db1d6b016 18.0 cited
-
psql: fix variable existence tab completion
- 927332b95e77 17.0 cited