Re: pg_regress cleans up tablespace twice.

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: pg_regress cleans up tablespace twice.
Дата
Msg-id 20200515025855.GE2462@paquier.xyz
обсуждение исходный текст
Ответ на Re: pg_regress cleans up tablespace twice.  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Ответы Re: pg_regress cleans up tablespace twice.  (Michael Paquier <michael@paquier.xyz>)
Re: pg_regress cleans up tablespace twice.  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-hackers
On Mon, May 11, 2020 at 05:13:54PM +0900, Kyotaro Horiguchi wrote:
> Tablespace directory cleanup is not done for all testing
> targets. Actually it is not done for the tools under bin/ except
> pg_upgrade.

Let's first take one problem at a time, as I can see that your patch
0002 is modifying a portion of what you added in 0001, and so let's
try to remove this WIN32 stuff from pg_regress.c.

+sub CleanupTablespaceDirectory
+{
+   my $tablespace = 'testtablespace';
+
+   rmtree($tablespace) if (-e $tablespace);
+   mkdir($tablespace);
+}
This check should use "-d" and not "-e" as it would be true for a file
as well.  Also, in pg_regress.c, we remove the existing tablespace
test directory in --outputdir, which is "." by default but it can be a
custom one.  Shouldn't you do the same logic in this new routine?  So
we should have an optional argument for the output directory that
defaults to `pwd` if not defined, no?  This means passing down the
argument only for upgradecheck() in vcregress.pl.

 sub isolationcheck
 {
     chdir "../isolation";
+    CleanupTablespaceDirectory();
     copy("../../../$Config/isolationtester/isolationtester.exe",
         "../../../$Config/pg_isolation_regress");
     my @args = (
[...]
     print "============================================================\n";
     print "Checking $module\n";
+    CleanupTablespaceDirectory();
     my @args = (
         "$topdir/$Config/pg_regress/pg_regress",
         "--bindir=${topdir}/${Config}/psql",
I would put that just before the system() calls for consistency with
the rest.
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: Transactions involving multiple postgres foreign servers, take 2
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: pg_regress cleans up tablespace twice.