Re: [PATCH] Honor PG_TEST_NOCLEAN for tempdirs

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Jacob Champion <jchampion(at)timescale(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Honor PG_TEST_NOCLEAN for tempdirs
Date: 2023-06-27 15:20:20
Message-ID: a2d6a208-13ac-69f8-9fb7-1d68d7fb5bbd@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2023-06-26 Mo 19:55, Jacob Champion wrote:
> Hello,
>
> I was running the test_pg_dump extension suite, and I got annoyed that
> I couldn't keep it from deleting its dump artifacts after a successful
> run. Here's a patch to make use of PG_TEST_NOCLEAN (which currently
> covers the test cluster's base directory) with the Test::Utils
> tempdirs too.
>
> (Looks like this idea was also discussed last year [1]; let me know if
> I missed any more recent suggestions.)

-        CLEANUP => 1);
+        CLEANUP => not defined $ENV{'PG_TEST_NOCLEAN'});

This doesn't look quite right. If PG_TEST_CLEAN had a value of 0 we
would still do the cleanup. I would probably use something like:

    CLEANUP => $ENV{'PG_TEST_NOCLEAN'} // 1

i.e. if it's not defined at all or has a value of undef, do the cleanup,
otherwise use the value.

cheers

andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-06-27 15:40:04 Re: ReadRecentBuffer() doesn't scale well
Previous Message Tristan Partin 2023-06-27 15:02:05 Make uselocale protection more consistent