Re: [HACKERS] Show backtrace when tap tests fail

Поиск
Список
Период
Сортировка
От David Steele
Тема Re: [HACKERS] Show backtrace when tap tests fail
Дата
Msg-id 4fbe8e34-3ce5-e8d3-0d4f-bc7432f97bb6@pgmasters.net
обсуждение исходный текст
Ответ на Re: [HACKERS] Show backtrace when tap tests fail  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Show backtrace when tap tests fail  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers
On 9/19/17 5:25 PM, Tom Lane wrote:
> Andres Freund <andres@anarazel.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@pgmasters.net


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jacob Champion
Дата:
Сообщение: Re: [HACKERS] [PATCH] Assert that the correct locks are held whencalling PageGetLSN()
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: [HACKERS] CREATE COLLATION does not sanitize ICU's BCP 47language tags. Should it?