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

Commit f433394

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 2f932f7 commit f433394

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

src/Makefile.global.in

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -597,16 +597,25 @@ submake-libpgfeutils: | submake-generated-headers
597597
#
598598
# Testing support
599599

600-
PL_TESTDB = pl_regression
601-
CONTRIB_TESTDB = contrib_regression
602-
ifneq ($(MODULE_big),)
603-
CONTRIB_TESTDB_MODULE = contrib_regression_$(MODULE_big)
604-
else
605-
ifneq ($(MODULES),)
606-
CONTRIB_TESTDB_MODULE = contrib_regression_$(MODULES)
600+
ifneq ($(USE_MODULE_DB),)
601+
PL_TESTDB = pl_regression_$(NAME)
602+
# Replace this with $(or ...) if we ever require GNU make 3.81.
603+
ifneq ($(MODULE_big),)
604+
CONTRIB_TESTDB=contrib_regression_$(MODULE_big)
605+
ISOLATION_TESTDB=isolation_regression_$(MODULE_big)
607606
else
608-
CONTRIB_TESTDB_MODULE = contrib_regression
607+
ifneq ($(MODULES),)
608+
CONTRIB_TESTDB=contrib_regression_$(word 1,$(MODULES))
609+
ISOLATION_TESTDB=isolation_regression_$(word 1,$(MODULES))
610+
else
611+
CONTRIB_TESTDB=contrib_regression_$(word 1,$(REGRESS))
612+
ISOLATION_TESTDB=isolation_regression_$(word 1,$(ISOLATION))
613+
endif
609614
endif
615+
else
616+
PL_TESTDB = pl_regression
617+
CONTRIB_TESTDB = contrib_regression
618+
ISOLATION_TESTDB = isolation_regression
610619
endif
611620

612621
ifdef NO_LOCALE

src/makefiles/pgxs.mk

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,7 @@ distclean maintainer-clean: clean
380380

381381
ifdef REGRESS
382382

383-
# Select database to use for running the tests
384-
ifneq ($(USE_MODULE_DB),)
385-
REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB_MODULE)
386-
else
387-
REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB)
388-
endif
383+
REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB)
389384

390385
# When doing a VPATH build, must copy over the data files so that the
391386
# driver script can find them. We have to use an absolute path for
@@ -413,6 +408,10 @@ ifndef PGXS
413408
$(MAKE) -C $(top_builddir)/src/test/isolation all
414409
endif
415410

411+
ifdef ISOLATION
412+
ISOLATION_OPTS += --dbname=$(ISOLATION_TESTDB)
413+
endif
414+
416415
# Standard rules to run regression tests including multiple test suites.
417416
# Runs against an installed postmaster.
418417
ifndef NO_INSTALLCHECK

0 commit comments

Comments
 (0)