diff --git a/meson.build b/meson.build index be532d1cc79..2a6e45b79a7 100644 --- a/meson.build +++ b/meson.build @@ -3247,6 +3247,8 @@ test_env = environment() test_initdb_template = meson.build_root() / 'tmp_install' / 'initdb-template' test_env.set('PG_REGRESS', pg_regress.full_path()) test_env.set('REGRESS_SHLIB', regress_module.full_path()) +# for Cluster.pm's portlock logic +test_env.set('top_builddir', meson.build_root()) # Test suites that are not safe by default but can be run if selected # by the user via the whitespace-separated list in variable PG_TEST_EXTRA. diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm index 9c210682c79..6cd32adbf74 100644 --- a/src/test/perl/PostgreSQL/Test/Cluster.pm +++ b/src/test/perl/PostgreSQL/Test/Cluster.pm @@ -169,9 +169,7 @@ INIT $portdir = $ENV{PG_TEST_PORT_DIR}; # Otherwise, try to use a directory at the top of the build tree # or as a last resort use the tmp_check directory - my $build_dir = - $ENV{MESON_BUILD_ROOT} - || $ENV{top_builddir} + my $build_dir = $ENV{top_builddir} || $PostgreSQL::Test::Utils::tmp_check; $portdir ||= "$build_dir/portlock"; $portdir =~ s!\\!/!g;