Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd08d880

Browse files
committed
In the pg_upgrade test suite, don't write to src/test/regress.
When this suite runs installcheck, redirect file creations fromsrc/test/regress to src/bin/pg_upgrade/tmp_check/regress. This closes arace condition in "make -j check-world". If the pg_upgrade suite wroteto a given src/test/regress/results file in parallel with the regularsrc/test/regress invocation writing it, a test failed spuriously. Evenwithout parallelism, in "make -k check-world", the suite finishingsecond overwrote the other's regression.diffs. This revealed test"largeobject" assuming @abs_builddir@ is getcwd(), so fix that, too.Buildfarm client REL_10, released forty-five days ago, supports savingregression.diffs from its new location. When an older client reports apg_upgradeCheck failure, it will no longer include regression.diffs.Back-patch to 9.5, where pg_upgrade moved to src/bin.Reviewed by Andrew Dunstan.Discussion:https://postgr.es/m/20181224034411.GA3224776@rfd.leadboat.com
1 parent592d5d7 commitd08d880

File tree

5 files changed

+38
-10
lines changed

5 files changed

+38
-10
lines changed

‎src/bin/pg_upgrade/test.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,18 @@ PGDATA="${BASE_PGDATA}.old"
110110
export PGDATA
111111
rm -rf"$BASE_PGDATA""$PGDATA"
112112

113+
# Send installcheck outputs to a private directory. This avoids conflict when
114+
# check-world runs pg_upgrade check concurrently with src/test/regress check.
115+
# To retrieve interesting files after a run, use pattern tmp_check/*/*.diffs.
116+
outputdir="$temp_root/regress"
117+
EXTRA_REGRESS_OPTS="$EXTRA_REGRESS_OPTS --outputdir=$outputdir"
118+
export EXTRA_REGRESS_OPTS
119+
rm -rf"$outputdir"
120+
mkdir"$outputdir"
121+
mkdir"$outputdir"/sql
122+
mkdir"$outputdir"/expected
123+
mkdir"$outputdir"/testtablespace
124+
113125
logdir=`pwd`/log
114126
rm -rf"$logdir"
115127
mkdir"$logdir"

‎src/test/regress/input/largeobject.source

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,12 @@ END;
203203

204204
SELECT lo_export(loid, '@abs_builddir@/results/lotest.txt') FROM lotest_stash_values;
205205

206-
\lo_import 'results/lotest.txt'
206+
\lo_import '@abs_builddir@/results/lotest.txt'
207207

208208
\set newloid :LASTOID
209209

210210
-- just make sure \lo_export does not barf
211-
\lo_export :newloid 'results/lotest2.txt'
211+
\lo_export :newloid '@abs_builddir@/results/lotest2.txt'
212212

213213
-- This is a hack to test that export/import are reversible
214214
-- This uses knowledge about the inner workings of large object mechanism
@@ -223,7 +223,7 @@ TRUNCATE lotest_stash_values;
223223

224224
\lo_unlink :newloid
225225

226-
\lo_import 'results/lotest.txt'
226+
\lo_import '@abs_builddir@/results/lotest.txt'
227227

228228
\set newloid_1 :LASTOID
229229

‎src/test/regress/output/largeobject.source

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,10 @@ SELECT lo_export(loid, '@abs_builddir@/results/lotest.txt') FROM lotest_stash_va
385385
1
386386
(1 row)
387387

388-
\lo_import 'results/lotest.txt'
388+
\lo_import '@abs_builddir@/results/lotest.txt'
389389
\set newloid :LASTOID
390390
-- just make sure \lo_export does not barf
391-
\lo_export :newloid 'results/lotest2.txt'
391+
\lo_export :newloid '@abs_builddir@/results/lotest2.txt'
392392
-- This is a hack to test that export/import are reversible
393393
-- This uses knowledge about the inner workings of large object mechanism
394394
-- which should not be used outside it. This makes it a HACK
@@ -407,7 +407,7 @@ SELECT lo_unlink(loid) FROM lotest_stash_values;
407407

408408
TRUNCATE lotest_stash_values;
409409
\lo_unlink :newloid
410-
\lo_import 'results/lotest.txt'
410+
\lo_import '@abs_builddir@/results/lotest.txt'
411411
\set newloid_1 :LASTOID
412412
SELECT lo_from_bytea(0, lo_get(:newloid_1)) AS newloid_2
413413
\gset

‎src/test/regress/output/largeobject_1.source

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,10 @@ SELECT lo_export(loid, '@abs_builddir@/results/lotest.txt') FROM lotest_stash_va
385385
1
386386
(1 row)
387387

388-
\lo_import 'results/lotest.txt'
388+
\lo_import '@abs_builddir@/results/lotest.txt'
389389
\set newloid :LASTOID
390390
-- just make sure \lo_export does not barf
391-
\lo_export :newloid 'results/lotest2.txt'
391+
\lo_export :newloid '@abs_builddir@/results/lotest2.txt'
392392
-- This is a hack to test that export/import are reversible
393393
-- This uses knowledge about the inner workings of large object mechanism
394394
-- which should not be used outside it. This makes it a HACK
@@ -407,7 +407,7 @@ SELECT lo_unlink(loid) FROM lotest_stash_values;
407407

408408
TRUNCATE lotest_stash_values;
409409
\lo_unlink :newloid
410-
\lo_import 'results/lotest.txt'
410+
\lo_import '@abs_builddir@/results/lotest.txt'
411411
\set newloid_1 :LASTOID
412412
SELECT lo_from_bytea(0, lo_get(:newloid_1)) AS newloid_2
413413
\gset

‎src/tools/msvc/vcregress.pl

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@
102102
subinstallcheck
103103
{
104104
my$schedule =shift ||'serial';
105+
installcheck_internal$schedule;
106+
return;
107+
}
108+
109+
subinstallcheck_internal
110+
{
111+
my ($schedule,@EXTRA_REGRESS_OPTS) =@_;
105112
my@args = (
106113
"../../../$Config/pg_regress/pg_regress",
107114
"--dlpath=.",
@@ -111,6 +118,7 @@ sub installcheck
111118
"--encoding=SQL_ASCII",
112119
"--no-locale");
113120
push(@args,$maxconn)if$maxconn;
121+
push(@args,@EXTRA_REGRESS_OPTS);
114122
system(@args);
115123
my$status =$? >> 8;
116124
exit$statusif$status;
@@ -546,6 +554,14 @@ sub upgradecheck
546554
$ENV{PATH} ="$bindir;$ENV{PATH}";
547555
my$data ="$tmp_root/data";
548556
$ENV{PGDATA} ="$data.old";
557+
my$outputdir ="$tmp_root/regress";
558+
my@EXTRA_REGRESS_OPTS = ("--outputdir=$outputdir");
559+
rmtree("$outputdir");
560+
mkdir"$outputdir" ||die$!;
561+
mkdir"$outputdir/sql" ||die$!;
562+
mkdir"$outputdir/expected" ||die$!;
563+
mkdir"$outputdir/testtablespace" ||die$!;
564+
549565
my$logdir ="$topdir/src/bin/pg_upgrade/log";
550566
(mkdir$logdir ||die$!)unless-d$logdir;
551567
print"\nRunning initdb on old cluster\n\n";
@@ -560,7 +576,7 @@ sub upgradecheck
560576
generate_db('', 91, 127,'');
561577

562578
print"\nSetting up data for upgrading\n\n";
563-
installcheck();
579+
installcheck_internal('serial',@EXTRA_REGRESS_OPTS);
564580

565581
# now we can chdir into the source dir
566582
chdir"$topdir/src/bin/pg_upgrade";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp