Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cc6077d

Browse files
committed
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
1 parent c8c7c93 commit cc6077d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/test/perl/PostgresNode.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ sub new
115115
my $self = {
116116
_port => $pgport,
117117
_host => $pghost,
118-
_basedir => TestLib::tempdir,
118+
_basedir => TestLib::tempdir("data_" . $name),
119119
_name => $name,
120120
_logfile => "$TestLib::log_path/${testname}_${name}.log" };
121121

src/test/perl/TestLib.pm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,11 @@ sub all_tests_passing
128128
#
129129
sub tempdir
130130
{
131+
my ($prefix) = @_;
132+
$prefix = "tmp_test" unless defined $prefix;
131133
return File::Temp::tempdir(
132-
'tmp_testXXXX',
133-
DIR => $tmp_check,
134+
$prefix . '_XXXX',
135+
DIR => $tmp_check,
134136
CLEANUP => 1);
135137
}
136138

0 commit comments

Comments
 (0)