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


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

Reply via email to