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

Commit 426d93d

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 b2307f8 commit 426d93d

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
@@ -595,16 +595,21 @@ submake-libpgfeutils: | submake-generated-headers
595595
#
596596
# Testing support
597597

598-
PL_TESTDB = pl_regression
599-
CONTRIB_TESTDB = contrib_regression
600-
ifneq ($(MODULE_big),)
601-
CONTRIB_TESTDB_MODULE = contrib_regression_$(MODULE_big)
602-
else
603-
ifneq ($(MODULES),)
604-
CONTRIB_TESTDB_MODULE = contrib_regression_$(MODULES)
598+
ifneq ($(USE_MODULE_DB),)
599+
PL_TESTDB = pl_regression_$(NAME)
600+
# Replace this with $(or ...) if we ever require GNU make 3.81.
601+
ifneq ($(MODULE_big),)
602+
CONTRIB_TESTDB=contrib_regression_$(MODULE_big)
605603
else
606-
CONTRIB_TESTDB_MODULE = contrib_regression
604+
ifneq ($(MODULES),)
605+
CONTRIB_TESTDB=contrib_regression_$(word 1,$(MODULES))
606+
else
607+
CONTRIB_TESTDB=contrib_regression_$(word 1,$(REGRESS))
608+
endif
607609
endif
610+
else
611+
PL_TESTDB = pl_regression
612+
CONTRIB_TESTDB = contrib_regression
608613
endif
609614

610615
ifdef NO_LOCALE

src/makefiles/pgxs.mk

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

372372
ifdef REGRESS
373373

374-
# Select database to use for running the tests
375-
ifneq ($(USE_MODULE_DB),)
376-
REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB_MODULE)
377-
else
378-
REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB)
379-
endif
374+
REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB)
380375

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

0 commit comments

Comments
 (0)