pgsql: perl tap: Use croak instead of die in our helper modules

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: perl tap: Use croak instead of die in our helper modules
Date: 2026-04-02 12:25:39
Message-ID: E1w8H7D-002bgY-04@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

perl tap: Use croak instead of die in our helper modules

Replace die with croak throughout Cluster.pm and Utils.pm (except in
INIT blocks and signal handlers, where die is correct) so that error
messages report the test script's line number rather than the helper
module's.

Add @CARP_NOT in Utils.pm listing PostgreSQL::Test::Cluster, so that
when a Utils function is called through a Cluster.pm wrapper, croak
skips both packages and reports the actual test-script caller.

Author: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
Reviewed-by: Andrew Dunstan <andrew(at)dunslane(dot)net>
Reviewed-by: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Reviewed-by: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Reviewed-by: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
Reviewed-by: Andres Freund <andres(at)anarazel(dot)de>
Discussion: https://postgr.es/m/DFYFWM053WHS.10K8ZPJ605UFK@jeltef.nl

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b8da9869b850246ea047038fb974830269b83bcc

Modified Files
--------------
src/test/perl/PostgreSQL/Test/Cluster.pm | 108 +++++++++++++++----------------
src/test/perl/PostgreSQL/Test/Utils.pm | 30 +++++----
2 files changed, 71 insertions(+), 67 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message John Naylor 2026-04-02 12:46:16 pgsql: Check for __cpuidex and __get_cpuid_count separately
Previous Message Tomas Vondra 2026-04-02 11:47:43 pgsql: jit: Change the default to off.