From cc6077d4d540d821548b704dc6e2f349da736f62 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Wed, 2 Mar 2016 17:02:36 -0300 Subject: [PATCH] Prefix temp data dirs with the node name 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 | 2 +- src/test/perl/TestLib.pm | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm index a8e6f0c3bb..4ca7f7780d 100644 --- a/src/test/perl/PostgresNode.pm +++ b/src/test/perl/PostgresNode.pm @@ -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" }; diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm index 564936e5e5..f1b5f8af8a 100644 --- a/src/test/perl/TestLib.pm +++ b/src/test/perl/TestLib.pm @@ -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); }