Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hAxML-00012n-VG for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Apr 2019 13:52:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hAxMK-0003RY-GR for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Apr 2019 13:52:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hAxMJ-0003RM-Sn for pgsql-hackers@lists.postgresql.org; Mon, 01 Apr 2019 13:52:20 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hAxMG-0004Hq-Pl for pgsql-hackers@postgresql.org; Mon, 01 Apr 2019 13:52:18 +0000 Received: by mail-pf1-x444.google.com with SMTP id 8so4620400pfr.4 for ; Mon, 01 Apr 2019 06:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=dpfe3lOPtkGIVCs0JR12QPY/v+9tCanj7phSUEsv1SU=; b=KleELhZeSOzQaGzYok2Pi+JsBnotcvjnikoghg1bt71sS/SZ73CNWHh1W8XFPT91M8 LFeZJn/ESNtTPhuKpUl3OQzhIWfUiSvLXIOUJPA8tof1dK9pcbEt4YPR9dZtiytCmHJA z5EX9g5XiMi17WmkBdzlPYrz+dEc299OS0xFE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=dpfe3lOPtkGIVCs0JR12QPY/v+9tCanj7phSUEsv1SU=; b=pqK6PpmedVromtXQj2DKCTmGYWPG+XzALpsBTQndIW21070+/6q3EAL+FQQUHjZp65 s6WsUw3Ej2qYUPQ66mG6P7KuvIPAa8g83QsAIoNEh6pdbpmRJAxD1NPJu0w6DTYISnqB lzbwWzYkrHrU97nnMCvW1AvXVCYjDla3FCeQvsupctHWozhctckpOFnDAKj4LzgO4w5o pZK4BfkC2pRjLO6rSDdRiGLyDccOcdbdKNWWz7+Indgur6qsHUk7J1GiFvU/dtEIrYha eejDKZyWOL586KoPLq1C3rAJ0HtSmtwq5VQncX7CHxe5+VBmJrB9sD28GCqyDGvo0yxO LVPA== X-Gm-Message-State: APjAAAWggb4drq1Lr75sKDy5T2obRuqNagi6z+jFlBQi0Q+0Hx9bfYUG IGarPTx/UpR84/XdgJsffLp8xVChg6I= X-Google-Smtp-Source: APXvYqxhCwV+A4yGNBVvd0s/IVKFhChVeIGvdjPnEJlMCR6sDRXOs+uNZ6/LjHlRR6c9cR+7yIZ6nA== X-Received: by 2002:a65:4689:: with SMTP id h9mr34232159pgr.295.1554126735576; Mon, 01 Apr 2019 06:52:15 -0700 (PDT) Received: from rfd.leadboat.com (108-233-125-46.lightspeed.sntcca.sbcglobal.net. [108.233.125.46]) by smtp.gmail.com with ESMTPSA id c1sm14151835pfd.114.2019.04.01.06.52.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 06:52:14 -0700 (PDT) Date: Mon, 1 Apr 2019 06:52:13 -0700 From: Noah Misch To: pgsql-hackers@postgresql.org Subject: Extending USE_MODULE_DB to more test suite types Message-ID: <20190401135213.GE891537@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8P1HSweYDcXXzwPJ" Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --8P1HSweYDcXXzwPJ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Some buildfarm runs have failed like this: ============== dropping database "pl_regression" ============== ERROR: database "pl_regression" is being accessed by other users DETAIL: There is 1 other session using the database. Affected runs: axolotl │ PLCheck-C │ REL9_5_STABLE │ 2015-08-21 19:29:19 │ https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=axolotl&dt=2015-08-21%2019:29:19 axolotl │ PLCheck-C │ REL9_6_STABLE │ 2017-03-16 17:43:16 │ https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=axolotl&dt=2017-03-16%2017:43:16 mandrill │ PLCheck-C │ HEAD │ 2017-05-13 17:14:12 │ https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mandrill&dt=2017-05-13%2017:14:12 tern │ PLCheck-C │ HEAD │ 2017-09-05 20:45:17 │ https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=tern&dt=2017-09-05%2020:45:17 mandrill │ PLCheck-C │ HEAD │ 2017-11-15 13:34:12 │ https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mandrill&dt=2017-11-15%2013:34:12 mandrill │ PLCheck-en_US.ISO8859-1 │ REL_10_STABLE │ 2018-03-15 05:24:41 │ https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mandrill&dt=2018-03-15%2005:24:41 frogfish │ TestModulesCheck-en_US.utf8 │ REL_11_STABLE │ 2019-01-29 01:32:51 │ https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=frogfish&dt=2019-01-29%2001:32:51 hornet │ PLCheck-C │ REL_11_STABLE │ 2019-01-29 01:52:29 │ https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=hornet&dt=2019-01-29%2001:52:29 I can reproduce that reliably by combining "make -C src/pl installcheck" with this hack: proc_exit(int code) { + pg_usleep(7000000); This happens because dropdb()'s call to CountOtherDBBackends() waits up to 5s for the database to become vacant. If the last plpython test backend takes more than 5s to exit, the pltcl suite fails. Most test suites are unaffected, thanks to USE_MODULE_DB=1 in the buildfarm script. However, PL suites ignore USE_MODULE_DB. So do the three src/test/modules directories that contain no C code and define $(REGRESS). Isolation suites, too, ignore USE_MODULE_DB. I would like to fix this as follows. When MODULES and MODULE_big are both unset, instead of using a constant string, derive the database name from the first element of $(REGRESS) or $(ISOLATION). I considered $(EXTENSION), but src/test/modules/commit_ts does not set it. $(REGRESS) and $(ISOLATION) are robust; in their absence, a directory simply won't invoke pg_regress to drop and/or create a database. I considered introducing a TESTDB_SUFFIX variable that src/test/modules directories could define, but that felt like needless flexibility. Treat src/pl in a similar fashion. With the attached patch, installcheck-world and check-world no longer reuse any database name in a given postmaster. Next, I'll mail this buildfarm client patch, after which any non-MSVC, v9.5+ (due to ddc2504) buildfarm run would no longer reuse any database name in a given postmaster: --- a/run_build.pl +++ b/run_build.pl @@ -1677 +1677,2 @@ sub make_pl_install_check - @checklog = run_log("cd $pgsql/src/pl && $make installcheck"); + my $cmd = "cd $pgsql/src/pl && $make USE_MODULE_DB=1 installcheck"; + @checklog = run_log($cmd); I plan to back-patch the PostgreSQL patch, to combat buildfarm noise. Perhaps someone has test automation that sets USE_MODULE_DB and nonetheless probes the exact database name "pl_regression", but I'm not too worried. The original rationale for USE_MODULE_DB, in commit ad69bd0, was to facilitate pg_upgrade testing. Folks using "make installcheck-world" to populate a cluster for pg_upgrade testing will see additional test coverage, which may cause additional failures. I'm fine with that, too. --8P1HSweYDcXXzwPJ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="USE_MODULE_DB-all-v1.patch" diff --git a/src/Makefile.global.in b/src/Makefile.global.in index c118f64..6b98d53 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -597,16 +597,25 @@ submake-libpgfeutils: | submake-generated-headers # # Testing support -PL_TESTDB = pl_regression -CONTRIB_TESTDB = contrib_regression -ifneq ($(MODULE_big),) - CONTRIB_TESTDB_MODULE = contrib_regression_$(MODULE_big) -else - ifneq ($(MODULES),) - CONTRIB_TESTDB_MODULE = contrib_regression_$(MODULES) +ifneq ($(USE_MODULE_DB),) + PL_TESTDB = pl_regression_$(NAME) + # Replace this with $(or ...) if we ever require GNU make 3.81. + ifneq ($(MODULE_big),) + CONTRIB_TESTDB=contrib_regression_$(MODULE_big) + ISOLATION_TESTDB=isolation_regression_$(MODULE_big) else - CONTRIB_TESTDB_MODULE = contrib_regression + ifneq ($(MODULES),) + CONTRIB_TESTDB=contrib_regression_$(word 1,$(MODULES)) + ISOLATION_TESTDB=isolation_regression_$(word 1,$(MODULES)) + else + CONTRIB_TESTDB=contrib_regression_$(word 1,$(REGRESS)) + ISOLATION_TESTDB=isolation_regression_$(word 1,$(ISOLATION)) + endif endif +else + PL_TESTDB = pl_regression + CONTRIB_TESTDB = contrib_regression + ISOLATION_TESTDB = isolation_regression endif ifdef NO_LOCALE diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk index 909a49f..271e7ea 100644 --- a/src/makefiles/pgxs.mk +++ b/src/makefiles/pgxs.mk @@ -380,12 +380,7 @@ distclean maintainer-clean: clean ifdef REGRESS -# Select database to use for running the tests -ifneq ($(USE_MODULE_DB),) - REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB_MODULE) -else - REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB) -endif +REGRESS_OPTS += --dbname=$(CONTRIB_TESTDB) # When doing a VPATH build, must copy over the data files so that the # driver script can find them. We have to use an absolute path for @@ -413,6 +408,10 @@ ifndef PGXS $(MAKE) -C $(top_builddir)/src/test/isolation all endif +ifdef ISOLATION +ISOLATION_OPTS += --dbname=$(ISOLATION_TESTDB) +endif + # Standard rules to run regression tests including multiple test suites. # Runs against an installed postmaster. ifndef NO_INSTALLCHECK --8P1HSweYDcXXzwPJ--