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
This commit is contained in:
Alvaro Herrera 2016-03-02 17:02:36 -03:00
parent c8c7c93de8
commit cc6077d4d5
2 changed files with 5 additions and 3 deletions

View 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" };

View 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);
}