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 1lOiV5-0002lR-Jx for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Mar 2021 14:59:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lOiV4-0003Um-I1 for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Mar 2021 14:59:18 +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 1lOfYR-0007nd-So for pgsql-hackers@lists.postgresql.org; Tue, 23 Mar 2021 11:50:35 +0000 Received: from feynman.df7cb.de ([195.49.152.168]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOfYO-00042l-2V for pgsql-hackers@lists.postgresql.org; Tue, 23 Mar 2021 11:50:35 +0000 Received: from msg.df7cb.de (unknown [IPv6:2a02:908:1478:7c00:76e5:bff:fef3:7e00]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by feynman.df7cb.de (Postfix) with ESMTPSA id 4F4V6s6qm0z3Dwk; Tue, 23 Mar 2021 12:50:29 +0100 (CET) Date: Tue, 23 Mar 2021 12:50:29 +0100 From: Christoph Berg To: Michael Paquier Cc: pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Re: Michael Paquier > Move tablespace path re-creation from the makefiles to pg_regress > > Moving this logic into pg_regress fixes a potential failure with > parallel tests when pg_upgrade and the main regression test suite both > trigger the makefile rule that cleaned up testtablespace/ under > src/test/regress. Even if pg_upgrade was triggering this rule, it has > no need to do so as it uses a different tablespace path. So if > pg_upgrade triggered the makefile rule for the tablespace setup while > the main regression test suite ran the tablespace cases, it would fail. > > 61be85a was a similar attempt at achieving that, but that broke cases > where the regression tests require to run under an Administrator > account, like with Appveyor. This change broke running the testsuite on an existing PG server, if server user and pg_regress client user are different. This is one of the tests exercised by Debian's autopkgtest suite. Previously I could create the tablespace directory, chown it to postgres, and fire up pg_regress with the correct options. Now pg_regress wipes that directory, recreates it, and then the server can't use it because user "postgres" can't write to it. I'm working around the problem now by running the tests as user "postgres", but does completely break in environments where users want to run the testsuite from a separate compilation user but don't have root. Old code: https://salsa.debian.org/postgresql/postgresql/-/blob/8b1217fcae3e64155bc35517acbd50c6f166d997/debian/tests/installcheck Workaround: https://salsa.debian.org/postgresql/postgresql/-/blob/cbc0240bec738b6ab3b61c498825b82c8ff21a70/debian/tests/installcheck Christoph