[HACKERS] A note about debugging TAP failures - Mailing list pgsql-hackers

From Tom Lane
Subject [HACKERS] A note about debugging TAP failures
Date
Msg-id 6205.1492883490@sss.pgh.pa.us
Whole thread Raw
Responses Re: [HACKERS] A note about debugging TAP failures  (Fabien COELHO <coelho@cri.ensmp.fr>)
Re: [HACKERS] A note about debugging TAP failures  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
I've whined before about how developer-unfriendly the TAP test
infrastructure is.  One concrete problem is that if there is a failure,
there is absolutely no way to get any information beyond what is in the
logs, because the test installation's data directory is unconditionally
blown away at run end.  I wanted to look at the core file from an
assertion failure, but of course that wasn't there anymore.  (I realize
I could've reconfigured my kernel to drop the core file somewhere else,
but what if I'd needed to look at the data directory per se?)

I got around this for the immediate need with this expedient hack:

diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm
index ae8d178..8f2f09c 100644
--- a/src/test/perl/TestLib.pm
+++ b/src/test/perl/TestLib.pm
@@ -138,7 +138,7 @@ sub tempdir    return File::Temp::tempdir(        $prefix . '_XXXX',        DIR     => $tmp_check,
-        CLEANUP => 1);
+        CLEANUP => 0);}sub tempdir_short

but that still wasn't exactly friendly, since at the end of the run
I had a bunch of randomly-named data directories and had to guess
which one corresponded to the failing test script.

I think we need to fix TestLib and/or PostgresNode so that there's a way
to make TAP tests not auto-clean their data directories at end of run,
without having to resort to editing the script like this.  It'd also be
helpful if the data directory pathname included the test script's name.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Pierre Ducroquet
Date:
Subject: Re: [HACKERS] Small patch for pg_basebackup argument parsing
Next
From: Sandeep Thakkar
Date:
Subject: Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL