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

Commit 32ce58e

Browse files
committed
Make test portlock logic work with meson
Previously the portlock logic, added in 9b4eafc, didn't actually work properly when the tests were run via meson. 9b4eafc used the MESON_BUILD_ROOT environment variable to determine the directory for the port lock directory, but that's never set for running the tests. That meant that each test used its own portlock dir, unless the PG_TEST_PORT_DIR environment variable was set. Fix the problem by setting top_builddir for the environment. That's also used for the autoconf/make build. Backpatch back to 16, where meson support was added. Reported-by: Zharkov Roman <r.zharkov@postgrespro.ru> Reviewed-by: Andrew Dunstan <andrew@dunslane.net> Backpatch-through: 16
1 parent 665cafe commit 32ce58e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

meson.build

+2
Original file line numberDiff line numberDiff line change
@@ -3401,6 +3401,8 @@ test_initdb_template = meson.build_root() / 'tmp_install' / 'initdb-template'
34013401
test_env.set('PG_REGRESS', pg_regress.full_path())
34023402
test_env.set('REGRESS_SHLIB', regress_module.full_path())
34033403
test_env.set('INITDB_TEMPLATE', test_initdb_template)
3404+
# for Cluster.pm's portlock logic
3405+
test_env.set('top_builddir', meson.build_root())
34043406

34053407
# Add the temporary installation to the library search path on platforms where
34063408
# that works (everything but windows, basically). On windows everything

src/test/perl/PostgreSQL/Test/Cluster.pm

+1-3
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,7 @@ INIT
168168
$portdir = $ENV{PG_TEST_PORT_DIR};
169169
# Otherwise, try to use a directory at the top of the build tree
170170
# or as a last resort use the tmp_check directory
171-
my $build_dir =
172-
$ENV{MESON_BUILD_ROOT}
173-
|| $ENV{top_builddir}
171+
my $build_dir = $ENV{top_builddir}
174172
|| $PostgreSQL::Test::Utils::tmp_check;
175173
$portdir ||= "$build_dir/portlock";
176174
$portdir =~ s!\\!/!g;

0 commit comments

Comments
 (0)