Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHnJ8-0000mV-8O for pgsql-bugs@arkaria.postgresql.org; Thu, 04 Mar 2021 12:42:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lHnJ5-0002Ho-Qh for pgsql-bugs@arkaria.postgresql.org; Thu, 04 Mar 2021 12:42:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHnJ5-0002Hh-KM for pgsql-bugs@lists.postgresql.org; Thu, 04 Mar 2021 12:42:19 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHnIz-00047A-HT for pgsql-bugs@lists.postgresql.org; Thu, 04 Mar 2021 12:42:19 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 0F9801405; Thu, 4 Mar 2021 07:42:10 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 04 Mar 2021 07:42:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=GxIqAnUOjt1ogp+ostPtNBRYGY7 7bVwlKqOI59giq98=; b=bQa7aEGIc+7BaTIV5tRGMr4Wc1eQOuzLZ5YV/nYbhU7 djasrRpXuJfMoHvx7EyozIgfoLn0Vuh8e/w2doSHlV9TZZRLSYaHCv9uVgl1R+u+ o0x+Ves7mSYY29lOJD3TEeJ02+d8leBY0lDX9hD9Bh+c95b/cNamIRB9/n6MI86g WuvOXa/Cr2u5TkBRxku8vds4Z78ARCL8FaS/C3xIksAzd48MUZvxiU6K0e1QCubK kKMbqdDSj2uX0n5TPp8hjUdYCAT9ITIeCi4UpNmJAyKdeKU4tYJzIyY5SSxMHBQi 73B/GuD++ml2XpQr/mHVV5tpURh+uYNsoAE2SXzw0Gw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=GxIqAn UOjt1ogp+ostPtNBRYGY77bVwlKqOI59giq98=; b=TyWT0ALVJvGPv0Xv6oYdFI JjbcgDe520Z2YY4BRm3sjgd2RTDq2KejGynEL0dtzItuHWt/Q11CZDWI/aBWRJXK Vw4v+ZcrK6Hce5BketXxY8hZaWIiqeSKfWp+19uwrh+tVv/s3/rZGEoZjO40Cw5L ZwG9mAt0Qak9TXZo6gdMVCare9XPlRFn2OfTAVseUzqUXKHa5tMzSoXNU+tmtrjt qBgZ/S2LtoN18NZKAOJidotABvF4MQgk4FNhhPHFP6k4OKW6JDbdGe8sIrnrCiwJ zyJpjQi74p5tdUuy+TxH/AmShDr712n2PtTcYAWQ82Tq+6FMsCN9WowKzX810BzQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddtgedgfeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhu ihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrh hnpedvgeduuefhtdeuleettdevjeehheeiveeuieegleetgeeljeelieeuieehgeevhfen ucfkphepudduuddruddtvddrudektddrudekheenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 0128924005B; Thu, 4 Mar 2021 07:42:08 -0500 (EST) Date: Thu, 4 Mar 2021 21:42:04 +0900 From: Michael Paquier To: r.zharkov@postgrespro.ru, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16914: Regression test of the worker_spi fails if USE_MODULE_DB environment variable is set. Message-ID: References: <16914-ca8dd84fef8db291@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="b1PhE4gajaHRbqkq" Content-Disposition: inline In-Reply-To: <16914-ca8dd84fef8db291@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --b1PhE4gajaHRbqkq Content-Type: multipart/mixed; boundary="NXDhZcSUX2abLzVi" Content-Disposition: inline --NXDhZcSUX2abLzVi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 04, 2021 at 07:43:11AM +0000, PG Bug reporting form wrote: > I found a little problem with the test on the master branch: >=20 > $ make -s -C src/test/modules/worker_spi check USE_MODULE_DB=3DTRUE > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D running regression test querie= s =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > test worker_spi ... FAILED 131652 ms > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D shutting down postmaster Fun. > Something like this fixes the problem: One problem with this solution is that this is not portable. Instead of generating dynamically the configuration file, here is funkier solution as we know that worker_spi would restart if the database it should connect to does not exist: let's use a completely different database name, not expected by any other modules. Then, this database gets created in worker_spi.sql, with a reconnection to it. -- Michael --NXDhZcSUX2abLzVi Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="worker-spi-test.patch" Content-Transfer-Encoding: quoted-printable diff --git a/src/test/modules/worker_spi/dynamic.conf b/src/test/modules/wo= rker_spi/dynamic.conf index bfe015f664..2f480be1da 100644 --- a/src/test/modules/worker_spi/dynamic.conf +++ b/src/test/modules/worker_spi/dynamic.conf @@ -1,2 +1,2 @@ shared_preload_libraries =3D worker_spi -worker_spi.database =3D contrib_regression +worker_spi.database =3D regression_worker_spi diff --git a/src/test/modules/worker_spi/expected/worker_spi.out b/src/test= /modules/worker_spi/expected/worker_spi.out index dc0a79bf75..c54d5e6cf8 100644 --- a/src/test/modules/worker_spi/expected/worker_spi.out +++ b/src/test/modules/worker_spi/expected/worker_spi.out @@ -1,3 +1,7 @@ +-- Create the database specific to this test, and reconnect to it. +-- This matches with the configuration of dynamic.conf. +CREATE DATABASE regression_worker_spi; +\c regression_worker_spi CREATE EXTENSION worker_spi; SELECT worker_spi_launch(4) IS NOT NULL; ?column?=20 diff --git a/src/test/modules/worker_spi/sql/worker_spi.sql b/src/test/modu= les/worker_spi/sql/worker_spi.sql index 4683523b29..61a9781bc1 100644 --- a/src/test/modules/worker_spi/sql/worker_spi.sql +++ b/src/test/modules/worker_spi/sql/worker_spi.sql @@ -1,3 +1,8 @@ +-- Create the database specific to this test, and reconnect to it. +-- This matches with the configuration of dynamic.conf. +CREATE DATABASE regression_worker_spi; +\c regression_worker_spi + CREATE EXTENSION worker_spi; SELECT worker_spi_launch(4) IS NOT NULL; -- wait until the worker completes its initialization --NXDhZcSUX2abLzVi-- --b1PhE4gajaHRbqkq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmBA1ZwACgkQnvQgOdby QH3JJg/9EpGYCGEj31KDoEBmynvohbzlmEXbyX/LlLaNMyWt2rTFUhXJWRXgGPDX o1Z6qwFQhiywG4QOq0Jdze0w5erRJZKfFO7SJkmy7ZKnf4oRHfhwSimalNwdzNFr bk1Yvz1I35/HnItke6oTdJO4H3JwYGZgsPRsbnhFlBipukj3RADeZqpTY4gyKKWy QCwNNfyZcKo1UzOTXxjI7jrG7/urdzyL11ZEgOn92qIdZtBn39a+j4RQ6xEgQkS8 3M9rVAMAROz+TRVqZnuEfBvHhdIfthXCvA8hAZEX+odxGZzmcNkwRUnYnrRLtJUH F3269guH5/gA2RVUYWaS0DDBzyP5iCHm+kK/ZNrVFPXbaJVBi3KvuVCUdpwuRADA /7MibGYeFFdkEF1ZsuLLT8XF1kZ0qWXr5hRFizBTPJZVJ3Nd/GPIXxr/IRWcgKdU 8gmccLHIkSOEaoxgmWdYWmZFpYbCIO+Sgag9aMS5p7kavY5DfNg59VkyRTCJZ1jh wOHegzOFvnX50hVryug5a4JqMOQ+xbpmvoiUHDX2DQM5EC4927jv8OmVwB0e97E/ 9+drfH0SAtZ9lxtbRwd+cYf1GiBgabqRj/WP0VCTUdY8dXx1+00BWyyN+xgaWfw4 MwP8uJHN9Bn57LA/OZ1use10xUE5W7ldvFO4iVonDjtHoMnWC6g= =m4qm -----END PGP SIGNATURE----- --b1PhE4gajaHRbqkq--