Re: prevent 006_transfer_modes.pl from leaving files behind

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Michael Paquier <michael(at)paquier(dot)xyz>, Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: prevent 006_transfer_modes.pl from leaving files behind
Date: 2025-04-08 13:30:31
Message-ID: 82ec2856-5794-41f1-ab05-a20adee64847@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2025-04-07 Mo 7:41 PM, Michael Paquier wrote:
> On Mon, Apr 07, 2025 at 04:45:52PM -0500, Nathan Bossart wrote:
>> The other pg_upgrade tests chdir to tmp_check prior to running pg_upgrade
>> to avoid leaving behind delete_old_cluster.{sh,bat}. 006_transfer_modes.pl
>> should, too. However, this test is a little different because it loops
>> over all of the available transfer modes and runs pg_upgrade for each one
>> supported by the platform. From my testing and code analysis, it seems
>> sufficient to change the directory once at the beginning of the test, but
>> we could alternatively save the current directory and change back to it in
>> each iteration to be safe.
>>
>> Thoughts?
> Hmm. Doing one chdir at the beginning of the test should be OK,
> because we don't do a move to a different directory within the test
> for each transfer mode tested. So your patch looks like the simplest
> thing to do to avoid the generation of these files. Note that
> delete_old_cluster.sh would be left around even if not using a VPATH
> build with ./configure (your commit message does not mention that).
> Even if .gitignore discards it, the file is here.

I don't think that matters. In non-vpath builds we expect the source
directory to be scribbled on. All sorts of things might be left around.

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 2025-04-08 13:35:37 Re: Draft for basic NUMA observability
Previous Message Tomas Vondra 2025-04-08 13:21:57 Re: Draft for basic NUMA observability