Re: Show backtrace when tap tests fail

From: David Steele <david(at)pgmasters(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>
Cc: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>, Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org, Craig Ringer <craig(at)2ndquadrant(dot)com>
Subject: Re: Show backtrace when tap tests fail
Date: 2017-09-19 22:36:01
Message-ID: 4fbe8e34-3ce5-e8d3-0d4f-bc7432f97bb6@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 9/19/17 5:25 PM, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
>> On 2017-09-19 17:15:21 -0400, Tom Lane wrote:
>>> Meh --- Carp::Always isn't standard either, so I think this is just extra
>>> complication with little value-add. Let's just do the Devel::Confess
>>> incantation as Dagfinn has it.
>
>> Has ~25 times the installation base on debian tho...
>
>> https://qa.debian.org/popcon.php?package=libdevel-confess-perl (13)
>> vs
>> https://qa.debian.org/popcon.php?package=libcarp-always-perl (300)
>
> Both of those read like "lost in the noise" to me. I think with
> either of these, we're more or less asking PG developers to install
> a dependency they probably didn't have before. We might as well
> ask them to install the more useful one.

I just use:

$SIG{__DIE__} = sub {Carp::confess @_};

It also includes the stack for the confess, but that's only a single
line and I don't care since the important information is at the top.

I have used this in production code and it doesn't seem to have any
nasty side effects, though this is only a last resort for when a defined
exception is not raised. For test code it should be more than sufficient.

I have not tried this on Perls < 5.10, though.

--
-David
david(at)pgmasters(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2017-09-19 22:47:04 Re: CREATE COLLATION does not sanitize ICU's BCP 47 language tags. Should it?
Previous Message chiru r 2017-09-19 22:32:09 Re: [HACKERS] USER Profiles for PostgreSQL