Skip to content

Commit 8541304

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 7c414cd commit 8541304

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
@@ -552,16 +552,21 @@ submake-generated-headers:
552552
#
553553
# Testing support
554554

555-
PL_TESTDB = pl_regression
556-
CONTRIB_TESTDB = contrib_regression
557-
ifneq ($(MODULE_big),)
558-
CONTRIB_TESTDB_MODULE = contrib_regression_$(MODULE_big)
559-
else
560-
ifneq ($(MODULES),)
561-
CONTRIB_TESTDB_MODULE = contrib_regression_$(MODULES)
555+
ifneq ($(USE_MODULE_DB),)
556+
PL_TESTDB = pl_regression_$(NAME)
557+
# Replace this with $(or ...) if we ever require GNU make 3.81.
558+
ifneq ($(MODULE_big),)
559+
CONTRIB_TESTDB=contrib_regression_$(MODULE_big)
562560
else
563-
CONTRIB_TESTDB_MODULE = contrib_regression
561+
ifneq ($(MODULES),)
562+
CONTRIB_TESTDB=contrib_regression_$(word 1,$(MODULES))
563+
else
564+
CONTRIB_TESTDB=contrib_regression_$(word 1,$(REGRESS))
565+
endif
564566
endif
567+
else
568+
PL_TESTDB = pl_regression
569+
CONTRIB_TESTDB = contrib_regression
565570
endif
566571

567572
ifdef NO_LOCALE

src/makefiles/pgxs.mk

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

253253
ifdef REGRESS
254254

255-
# Select database to use for running the tests
256-
ifneq ($(USE_MODULE_DB),)
257-
REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB_MODULE)
258-
else
259-
REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB)
260-
endif
255+
REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB)
261256

262257
# When doing a VPATH build, must copy over the data files so that the
263258
# driver script can find them. We have to use an absolute path for

0 commit comments

Comments
 (0)