Re: bailing out in tap tests nearly always a bad idea - Mailing list pgsql-hackers

From Andres Freund
Subject Re: bailing out in tap tests nearly always a bad idea
Date
Msg-id 20220213234719.fk3ktieef7c4rghv@alap3.anarazel.de
Whole thread Raw
In response to Re: bailing out in tap tests nearly always a bad idea  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: bailing out in tap tests nearly always a bad idea  (Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>)
List pgsql-hackers
Hi,

On 2022-02-13 18:32:59 -0500, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > Best with a
> > central function signalling fatal error, rather than individual uses of die
> > or such.
>
> Huh, doesn't Test::More already provide a sane way to do this?

I looked, and didn't see anything. But I'm not a perl person, so I might just
have missed something.


> If not, why isn't die() good enough?  (I don't think you can
> realistically expect to prohibit die() anywhere in the TAP tests.)

The output of dying isn't great either:

t/000_fail.pl ........................ Dubious, test returned 25 (wstat 6400, 0x1900)
No subtests run

it'd be nicer if that that showed the actual reason for failing, rather than
the unhelpful "Dubious, test returned" stuff. But it's still better than
BAIL_OUT. So I thought that putting the failure handling in a central routine
would allow us to make the exit nicer in a central place / at a later stage...

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: xml_is_well_formed (was Re: buildfarm warnings)
Next
From: Michael Paquier
Date:
Subject: Re: pgsql: Add suport for server-side LZ4 base backup compression.