]> granicus.if.org Git - postgresql/commitdiff
Prefix temp data dirs with the node name
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 2 Mar 2016 20:02:36 +0000 (17:02 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 2 Mar 2016 21:22:45 +0000 (18:22 -0300)
This makes it easier to relate the temporary data dirs to each node in
a test script.

Author: Kyotaro Horiguchi
Reviewed-By: Craig Ringer, Alvaro Herrera
src/test/perl/PostgresNode.pm
src/test/perl/TestLib.pm

index a8e6f0c3bbf5fa4d2771d3114a0c7682d562ea18..4ca7f7780db2ff480c63d623c0073c196300e3a8 100644 (file)
@@ -115,7 +115,7 @@ sub new
        my $self   = {
                _port     => $pgport,
                _host     => $pghost,
-               _basedir  => TestLib::tempdir,
+               _basedir  => TestLib::tempdir("data_" . $name),
                _name     => $name,
                _logfile  => "$TestLib::log_path/${testname}_${name}.log" };
 
index 564936e5e5758f4fd5ee96f6917cd77e2274691c..f1b5f8af8a06a8e092c7c5a40df0ad79cdce9f14 100644 (file)
@@ -128,9 +128,11 @@ sub all_tests_passing
 #
 sub tempdir
 {
+       my ($prefix) = @_;
+       $prefix = "tmp_test" unless defined $prefix;
        return File::Temp::tempdir(
-               'tmp_testXXXX',
-               DIR => $tmp_check,
+               $prefix . '_XXXX',
+               DIR     => $tmp_check,
                CLEANUP => 1);
 }