Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 10b72de

Browse files
committed
In the pg_upgrade test suite, remove and recreate "tmp_check".
This allows "vcregress upgradecheck" to pass twice in immediate succession, and it's more like how $(prove_check) works. Back-patch to 9.5, where pg_upgrade moved to src/bin. Discussion: https://postgr.es/m/20190520012436.GA1480421@rfd.leadboat.com
1 parent d5ec46b commit 10b72de

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/bin/pg_upgrade/test.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ export PGHOST
6969

7070
# don't rely on $PWD here, as old shells don't set it
7171
temp_root=`pwd`/tmp_check
72+
rm -rf "$temp_root"
73+
mkdir "$temp_root"
7274

7375
: ${oldbindir=$bindir}
7476

@@ -93,7 +95,6 @@ export PATH
9395
BASE_PGDATA="$temp_root/data"
9496
PGDATA="${BASE_PGDATA}.old"
9597
export PGDATA
96-
rm -rf "$BASE_PGDATA" "$PGDATA"
9798

9899
logdir=`pwd`/log
99100
rm -rf "$logdir"

src/tools/msvc/vcregress.pl

+4-2
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,8 @@ sub upgradecheck
546546
$ENV{PGHOST} = 'localhost';
547547
$ENV{PGPORT} ||= 50432;
548548
my $tmp_root = "$topdir/src/bin/pg_upgrade/tmp_check";
549-
(mkdir $tmp_root || die $!) unless -d $tmp_root;
549+
rmtree($tmp_root);
550+
mkdir $tmp_root || die $!;
550551
my $upg_tmp_install = "$tmp_root/install"; # unshared temp install
551552
print "Setting up temp install\n\n";
552553
Install($upg_tmp_install, "all", $config);
@@ -559,7 +560,8 @@ sub upgradecheck
559560
my $data = "$tmp_root/data";
560561
$ENV{PGDATA} = "$data.old";
561562
my $logdir = "$topdir/src/bin/pg_upgrade/log";
562-
(mkdir $logdir || die $!) unless -d $logdir;
563+
rmtree($logdir);
564+
mkdir $logdir || die $!;
563565
print "\nRunning initdb on old cluster\n\n";
564566
standard_initdb() or exit 1;
565567
print "\nStarting old cluster\n\n";

0 commit comments

Comments
 (0)