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 1mRN8Y-0004Fy-0K for pgsql-committers@arkaria.postgresql.org; Fri, 17 Sep 2021 23:19:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mRN8W-0001VL-OR for pgsql-committers@arkaria.postgresql.org; Fri, 17 Sep 2021 23:19:16 +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 1mRN8V-0001VD-Eg for pgsql-committers@lists.postgresql.org; Fri, 17 Sep 2021 23:19:16 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mRN8O-0003v7-2I for pgsql-committers@lists.postgresql.org; Fri, 17 Sep 2021 23:19:15 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id E517C320028E; Fri, 17 Sep 2021 19:19:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 17 Sep 2021 19:19:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=ekUvFnsB6dYskVHLDg3Tyv9pWuX 765xPVdsP1d94PKo=; b=M8N3Gv4ghT2nZ2UkeHCyGgqEglJfC2Qru/5amkZPUKt 8zjyuCQDdF9EY1H8cnxjW5rfwIrTdyPFx/LSKyRUMsW/4ngqFTMGOByBC+9r0wAb uK52b9w2/2C8x1T9GX/mRXhyvGZF1a0u6ZsmCHDJYseMcScFeK3TBX7ESdPX5M7J H6NVNzgZOJynv9V60GQWcVOe6eFE9xdnHU407kMj4V0osh/AITVYS2fTN0j74scg B//HoNakHRuDzBepMYFMIfRxKT03KQPaqltJwDPUa2GoZAO6oGgH62W73FVDwm5A RzuZELxnrp5ExOrn9JZAXlGttax6WnIPFUXcWqnXX0g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm3; bh=ekUvFn sB6dYskVHLDg3Tyv9pWuX765xPVdsP1d94PKo=; b=kZepSF6wAAs/f+DD3hRreU rjZ2A/la/dNLm2CbHHAdaUcczxc9r4mlqBCNxYakeVY+xLZvfI6JKs20ePUgHYu5 nW0c0w/53/lT3Szz6t5hB/eEBTV9DAa8g1urFlKUKpK6GCcPr7lGxjN7UYXFYAOd 0rA63I0mZg4rTT5365adV3gjkdgcumFwR0Qe/+BfeZEsuz5R/iAy16bpI+y7wxX4 AXnX/kXWO5dWvwotVTMYXOqVkng+RVIcRsN7nSUtqsCqUmzupq9fPVGF/8PXoG3G t51pg9V/SNR2w46IY/Xb5pFHbrs5W+HWDrvfkwcmTJgLD8VW9il12q7Ey+3aWxzA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehjedgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt udenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeevtdfgkeduudeuveetfeeggfej uddvtdetuefhleeuffeukeeihfejgfeigeduleenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 Sep 2021 19:19:01 -0400 (EDT) Date: Sat, 18 Sep 2021 08:18:58 +0900 From: Michael Paquier To: Andrew Dunstan Cc: Tom Lane , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Support "postgres -C" with runtime-computed GUCs Message-ID: References: <1252480.1631829409@sss.pgh.pa.us> <22a1c05f-a931-ba46-fb88-ac9680e7816a@dunslane.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LzFW3QWGL6EawvJZ" Content-Disposition: inline In-Reply-To: <22a1c05f-a931-ba46-fb88-ac9680e7816a@dunslane.net> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --LzFW3QWGL6EawvJZ Content-Type: multipart/mixed; boundary="/hVa3VIlwG785P1g" Content-Disposition: inline --/hVa3VIlwG785P1g Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 17, 2021 at 03:18:38PM -0400, Andrew Dunstan wrote: > The fixups for command_checks_all should go before the loops, not inside > them. Right. > I would probably add a single line like this just after the call that > checks the status: >=20 > =A0=A0 foreach ($stderr, $stdout) { s/\r\n/\n/g if $Config{osname} eq 'ms= ys'; } Yes, that works. Fine by me to use this grammar. > although maybe perltidy would reformat that. And perltidy tells me nothing here. -- Michael --/hVa3VIlwG785P1g Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fix-tap-msys-crlf-2.patch" Content-Transfer-Encoding: quoted-printable diff --git a/src/bin/pg_checksums/t/002_actions.pl b/src/bin/pg_checksums/t= /002_actions.pl index 97492caab4..2cc8b68c75 100644 --- a/src/bin/pg_checksums/t/002_actions.pl +++ b/src/bin/pg_checksums/t/002_actions.pl @@ -6,7 +6,6 @@ =20 use strict; use warnings; -use Config; use PostgresNode; use TestLib; =20 @@ -182,18 +181,13 @@ command_fails( # Test postgres -C for an offline cluster. # Run-time GUCs are safe to query here. Note that a lock file is created, # then unlinked, leading to an extra LOG entry showing in stderr. -SKIP: -{ - skip "unstable output generated with Msys", 3 - if ($Config{osname} eq 'msys'); - command_checks_all( - [ 'postgres', '-D', $pgdata, '-C', 'data_checksums' ], - 0, - [qr/^on$/], - # LOG entry when unlinking lock file. - [qr/database system is shut down/], - 'data_checksums=3Don is reported on an offline cluster'); -} +command_checks_all( + [ 'postgres', '-D', $pgdata, '-C', 'data_checksums' ], + 0, + [qr/^on$/], + # LOG entry when unlinking lock file. + [qr/database system is shut down/], + 'data_checksums=3Don is reported on an offline cluster'); =20 # Checks cannot happen with an online cluster $node->start; diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm index cbab1587cc..15f4e6f56e 100644 --- a/src/test/perl/TestLib.pm +++ b/src/test/perl/TestLib.pm @@ -434,6 +434,7 @@ sub run_command my ($cmd) =3D @_; my ($stdout, $stderr); my $result =3D IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr; + foreach ($stderr, $stdout) { s/\r\n/\n/g if $Config{osname} eq 'msys'; } chomp($stdout); chomp($stderr); return ($stdout, $stderr); @@ -878,6 +879,7 @@ sub command_like my $result =3D IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr; ok($result, "$test_name: exit code 0"); is($stderr, '', "$test_name: no stderr"); + $stdout =3D~ s/\r\n/\n/g if $Config{osname} eq 'msys'; like($stdout, $expected_stdout, "$test_name: matches"); return; } @@ -930,6 +932,7 @@ sub command_fails_like print("# Running: " . join(" ", @{$cmd}) . "\n"); my $result =3D IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr; ok(!$result, "$test_name: exit code not 0"); + $stderr =3D~ s/\r\n/\n/g if $Config{osname} eq 'msys'; like($stderr, $expected_stderr, "$test_name: matches"); return; } @@ -974,6 +977,8 @@ sub command_checks_all if $ret & 127; $ret =3D $ret >> 8; =20 + foreach ($stderr, $stdout) { s/\r\n/\n/g if $Config{osname} eq 'msys'; } + # check status ok($ret =3D=3D $expected_ret, "$test_name status (got $ret vs expected $expected_ret)"); --/hVa3VIlwG785P1g-- --LzFW3QWGL6EawvJZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmFFImIACgkQnvQgOdby QH1QIw//eya8eTJ64b3PhdeOJHlpz+ii56TUPEc/MrplpWgwpoI4dlBs5wd9fqqQ kPmWU6uVKRncLiQWFVqAUQIakyToZ1uh0GRUc/GVJOoo9nvxmmS7pQGzT1DkYmqv yiB8Up7MZMF31wouo1zKhlYPVlvnRoVYUuI3oTatmTbzzmd+k2vTsMKmVwV5nTVN zyoOzG35cnFbGEF8BS/hCl852bYlTXEJ4wn2DWuMOGSQwPS5AiuKSxBV9/U/+I1z /qeIq1lh/8KH9hvZCDVV1t/SNMdz8wsFAsk0snLWleMeDvyH1s2nmApDv8V9519+ nFsfFnjQPquJPH2U5YRLak/Gu/PlnESOeuLz07LsXmWkynkA3/qMSedKQNdwQpSO v8GZmSy2lv+J7SIfhdqtKpkJElrxE0WpyQ5z7EjyPf5tI2I9qoVqGNAXA+cRpuhA TgTg4q/o1WfkZdDlmGTE/R92pRzW0/4p+H8PXg7CSY8II7SkPItM0nu+xumKTQa1 vqrzso3pHgEQG2zyZ+PkHCbQPLW7A/aNyU3WP5JP9yz1N9bdvE/2t0ojAIkQ+4fc Jj1SHAjJuFe7nbCdmWyCS5uoB+DkwHu6THQgUA2bZQELYxxCKxRcOZRY7w4eadec 2l2Q9wpVO9u/JEpkjuXG6w73tnSllngCmoVR9rKwik0GHJ6SS3M= =FDJ/ -----END PGP SIGNATURE----- --LzFW3QWGL6EawvJZ--