From: Nathan Bossart <nathandbossart@gmail.com>
To: pgsql-hackers@postgresql.org
Cc: andrew@dunslane.net
Subject: prevent 006_transfer_modes.pl from leaving files behind
Date: Mon, 7 Apr 2025 16:45:52 -0500
Message-ID: <Z_RHkG770w3SE0yU@nathan> (raw)
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?
--
nathan
Attachments:v1-0001-Fix-the-006_transfer_modes.pl-test.patch (text/plain, 1.3K) download
From a349a98b19708984dc677e5809038d343d67bf17 Mon Sep 17 00:00:00 2001
From: Nathan Bossart <nathan@postgresql.org>
Date: Mon, 7 Apr 2025 16:23:44 -0500
Subject: [PATCH v1 1/1] Fix the 006_transfer_modes.pl test.
This test was leaving files like delete_old_cluster.sh in the
source directory for VPATH and meson builds. To fix, change the
directory to tmp_check before running the test, as was done in
commits 15b6d21553, 8af917be6b, and c462b054ba.
Oversight in commit af0d4901c1.
Reported-by: Andrew Dunstan <andrew@dunslane.net> (on Discord)
Discussion: ???
---
src/bin/pg_upgrade/t/006_transfer_modes.pl | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/bin/pg_upgrade/t/006_transfer_modes.pl b/src/bin/pg_upgrade/t/006_transfer_modes.plindex 34fddbcdab5..ed713a7d44d 100644--- a/src/bin/pg_upgrade/t/006_transfer_modes.pl+++ b/src/bin/pg_upgrade/t/006_transfer_modes.pl@@ -102,6 +102,11 @@ sub test_mode
$new->clean_node();
}
+# In a VPATH build, we'll be started in the source directory, but we want+# to run pg_upgrade in the build directory so that any files generated finish+# in it, like delete_old_cluster.{sh,bat}.+chdir ${PostgreSQL::Test::Utils::tmp_check};+
test_mode('--clone');
test_mode('--copy');
test_mode('--copy-file-range');
--
2.39.5 (Apple Git-154)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: nathandbossart@gmail.com, andrew@dunslane.net
Subject: Re: prevent 006_transfer_modes.pl from leaving files behind
In-Reply-To: <Z_RHkG770w3SE0yU@nathan>
References: <Z_RHkG770w3SE0yU@nathan>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox