Re: Show backtrace when tap tests fail

From: ilmari(at)ilmari(dot)org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=)
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: David Steele <david(at)pgmasters(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Show backtrace when tap tests fail
Date: 2017-09-20 10:26:46
Message-ID: d8jmv5pekd5.fsf@dalvik.ping.uio.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Craig Ringer <craig(at)2ndquadrant(dot)com> writes:

> On 20 September 2017 at 06:36, David Steele <david(at)pgmasters(dot)net> wrote:
>
>>
>> I just use:
>>
>> $SIG{__DIE__} = sub {Carp::confess @_};

That is the basic idea behind both Carp::Always and Devel::Confess, but
they also avoid breaking non-string exceptions (references and objects)
being thrown and caught. Devel::Confess jumps through even more hoops
to add backtraces to these without breaking code catching them.

See the DESCRIPTION and CAVEATS sections (and the source, if you've got
a strong stomach) of https://metacpan.org/pod/Devel::Confess for some of
the hairy details.

> That's what I patched into my TestLib.pm too, until I learned of
> Carp::Always.
>
> I'd rather have Carp::Always, but it's definitely an OK fallback.

I agree with Tom that we should just go for Devel::Confess with no
fallbacks (because of the above-mentioned potential breakage). This is
mainly for the convenience of developers and the buildfarm, not end
users.

- ilmari
--
- Twitter seems more influential [than blogs] in the 'gets reported in
the mainstream press' sense at least. - Matt McLeod
- That'd be because the content of a tweet is easier to condense down
to a mainstream media article. - Calle Dybedahl

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-09-20 10:34:48 Re: Page Scan Mode in Hash Index
Previous Message Alexander Korotkov 2017-09-20 09:58:57 Re: Allow GiST opcalsses without compress\decompres functions