Skip to content

Commit 624edab

Browse files
committed
Handle USE_MODULE_DB for all tests able to use an installed postmaster.
When $(MODULES) and $(MODULE_big) are empty, derive the database name from the first element of $(REGRESS) instead of using a constant string. When deriving the database name from $(MODULES), use its first element instead of the entire list; the earlier approach would fail if any multi-module directory had $(REGRESS) tests. Treat isolation suites and src/pl correspondingly. Under USE_MODULE_DB=1, installcheck-world and check-world no longer reuse any database name in a given postmaster. Buildfarm members axolotl, mandrill and frogfish saw spurious "is being accessed by other users" failures that would not have happened without database name reuse. (The CountOtherDBBackends() 5s deadline expired during DROP DATABASE; a backend for an earlier test suite had used the same database name and had not yet exited.) Back-patch to 9.4 (all supported versions), except bits pertaining to isolation suites. Concept reviewed by Andrew Dunstan, Andres Freund and Tom Lane. Discussion: https://postgr.es/m/20190401135213.GE891537@rfd.leadboat.com
1 parent 3a70b66 commit 624edab

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/Makefile.global.in

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -512,16 +512,21 @@ submake-libpgport:
512512
#
513513
# Testing support
514514

515-
PL_TESTDB = pl_regression
516-
CONTRIB_TESTDB = contrib_regression
517-
ifneq ($(MODULE_big),)
518-
CONTRIB_TESTDB_MODULE = contrib_regression_$(MODULE_big)
519-
else
520-
ifneq ($(MODULES),)
521-
CONTRIB_TESTDB_MODULE = contrib_regression_$(MODULES)
515+
ifneq ($(USE_MODULE_DB),)
516+
PL_TESTDB = pl_regression_$(NAME)
517+
# Replace this with $(or ...) if we ever require GNU make 3.81.
518+
ifneq ($(MODULE_big),)
519+
CONTRIB_TESTDB=contrib_regression_$(MODULE_big)
522520
else
523-
CONTRIB_TESTDB_MODULE = contrib_regression
521+
ifneq ($(MODULES),)
522+
CONTRIB_TESTDB=contrib_regression_$(word 1,$(MODULES))
523+
else
524+
CONTRIB_TESTDB=contrib_regression_$(word 1,$(REGRESS))
525+
endif
524526
endif
527+
else
528+
PL_TESTDB = pl_regression
529+
CONTRIB_TESTDB = contrib_regression
525530
endif
526531

527532
ifdef NO_LOCALE

src/makefiles/pgxs.mk

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,7 @@ distclean maintainer-clean: clean
256256

257257
ifdef REGRESS
258258

259-
# Select database to use for running the tests
260-
ifneq ($(USE_MODULE_DB),)
261-
REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB_MODULE)
262-
else
263-
REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB)
264-
endif
259+
REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB)
265260

266261
# where to find psql for running the tests
267262
PSQLDIR = $(bindir)

0 commit comments

Comments
 (0)