Skip to content

Commit 28fcaa6

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 514d47d commit 28fcaa6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3247,6 +3247,8 @@ test_env = environment()
32473247
test_initdb_template = meson.build_root() / 'tmp_install' / 'initdb-template'
32483248
test_env.set('PG_REGRESS', pg_regress.full_path())
32493249
test_env.set('REGRESS_SHLIB', regress_module.full_path())
3250+
# for Cluster.pm's portlock logic
3251+
test_env.set('top_builddir', meson.build_root())
32503252

32513253
# Test suites that are not safe by default but can be run if selected
32523254
# by the user via the whitespace-separated list in variable PG_TEST_EXTRA.

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

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

0 commit comments

Comments
 (0)