aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/pg_rewind/RewindTest.pm21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/bin/pg_rewind/RewindTest.pm b/src/bin/pg_rewind/RewindTest.pm
index 1045caa09ad..4dabffacbb4 100644
--- a/src/bin/pg_rewind/RewindTest.pm
+++ b/src/bin/pg_rewind/RewindTest.pm
@@ -62,15 +62,8 @@ our @EXPORT = qw(
clean_rewind_test
);
-# A temporary directory created with 'tempdir' is deleted automatically at
-# the end of the tests. You can change it to a constant if you need to keep it
-# for debugging purposes,
-my $testroot = tempdir;
-
-our $test_master_datadir = "$testroot/data_master";
-our $test_standby_datadir = "$testroot/data_standby";
-
-mkdir $testroot;
+our $test_master_datadir = "$tmp_check/data_master";
+our $test_standby_datadir = "$tmp_check/data_standby";
# Define non-conflicting ports for both nodes.
my $port_master = $ENV{PGPORT};
@@ -273,9 +266,8 @@ sub run_pg_rewind
# Keep a temporary postgresql.conf for master node or it would be
# overwritten during the rewind.
- copy(
- "$test_master_datadir/postgresql.conf",
- "$testroot/master-postgresql.conf.tmp");
+ copy("$test_master_datadir/postgresql.conf",
+ "$tmp_check/master-postgresql.conf.tmp");
# Now run pg_rewind
if ($test_mode eq "local")
@@ -307,9 +299,8 @@ sub run_pg_rewind
}
# Now move back postgresql.conf with old settings
- move(
- "$testroot/master-postgresql.conf.tmp",
- "$test_master_datadir/postgresql.conf");
+ move("$tmp_check/master-postgresql.conf.tmp",
+ "$test_master_datadir/postgresql.conf");
# Plug-in rewound node to the now-promoted standby node
append_to_file(