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 1mR208-00036J-HC for pgsql-committers@arkaria.postgresql.org; Fri, 17 Sep 2021 00:45:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mR206-00008P-Mb for pgsql-committers@arkaria.postgresql.org; Fri, 17 Sep 2021 00:45:10 +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 1mR205-00008H-7P for pgsql-committers@lists.postgresql.org; Fri, 17 Sep 2021 00:45:10 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mR202-0001M8-20 for pgsql-committers@lists.postgresql.org; Fri, 17 Sep 2021 00:45:08 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B89DC5C0174; Thu, 16 Sep 2021 20:45:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 16 Sep 2021 20:45:03 -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=e0AJ+VO7Rh3fLhMD1pD6gI/ePSM svQ4VqYuYm6YgSdo=; b=hc31edhQz5ikPhE2qyeTXMnu89oooXFeQPQT1C6UzQq AwBYaZR5N+x4wY1v/UAFXJ7A4kww6Tc/Qug9FSevGseFce+ctpTP/EvVqpp3uzQ2 AIZuvbgfJZAyGfO5g3SSMoJwjiJEDid/Gp+A0s5mV5eDrJdYIsV6drm+FGdhQawB 7RvUOBGWYN4psvGoD2q06Jz9229OFeA0bL3EpDFVk4koIuGWq+n5GbLGZn4ZUO+l t5AXQOuhYZwSifflbZxnUEG//kS6TFNJYb/qYwWOGwqE/jturWE4q2X//K2LU9tC FQeQq+9SIaKaQYXt5IPuau7k7TnQIP9NzYucdVg57gA== 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=e0AJ+V O7Rh3fLhMD1pD6gI/ePSMsvQ4VqYuYm6YgSdo=; b=hOIwHcFzeLTTr4VBTJdoRL IL1njC4K4/G+x43cgn33RguwMjgXmbCnTwuSwD7EL7P4LaSdAAUFyB2RGa0Wlzki PLuf+vqWuY69e2i8Q3fQd3txhcVvpEXcSOs3j3Yzd0qpmfSNl6I/HsHKXKPWoTft jJuHr2Id/jQwT+Awj7Tm5lJxCte1T8NunbGeq6BVDKG8ckztIOJ26btGImKNB0+V k9jbZJjE76vLiZ4WtR9xGtpDT96i+a0lNuu5aInTdFrn+Fa6wfUYEgzEYCwZNgHL 9BEYpGyLiIJhZGcBbsacRU3uPnPV3t3UQwQ7R3FkCg7H7NnF9oOat2pk/njr8uZg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehhedgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpedvgeduuefhtdeuleettdevjeeh heeiveeuieegleetgeeljeelieeuieehgeevhfenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Sep 2021 20:45:01 -0400 (EDT) Date: Fri, 17 Sep 2021 09:44:57 +0900 From: Michael Paquier To: Tom Lane Cc: pgsql-committers@lists.postgresql.org, Andrew Dunstan Subject: Re: pgsql: Support "postgres -C" with runtime-computed GUCs Message-ID: References: <1252480.1631829409@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="logTrinR5QSRBE0P" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --logTrinR5QSRBE0P Content-Type: multipart/mixed; boundary="QY4Df8rCVkcTFZsU" Content-Disposition: inline --QY4Df8rCVkcTFZsU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 17, 2021 at 08:08:44AM +0900, Michael Paquier wrote: > I am not completely sure what's going on here yet, so I'll just switch > the test to be skipped when Msys is involved for now. That should be > enough to bring back those machines to green. So, after drinking down a coffee, I have remembered the difference between the Msys and native perls when it comes to IPC::Run: - Msys perl generates \r\n. - Native perl generates \n. We have already a couple of places where we filter that out, like PostgresNode::psql or slurp_file. But we are missing some spots before calling like() for outputs generated by IPC::Run. I have=20 tracked all those places with the attached, and I think that this should take care of the failure seen here while preventing future problems. Any thoughts? -- Michael --QY4Df8rCVkcTFZsU Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fix-tap-msys-crlf.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..bde429e476 100644 --- a/src/test/perl/TestLib.pm +++ b/src/test/perl/TestLib.pm @@ -434,6 +434,8 @@ sub run_command my ($cmd) =3D @_; my ($stdout, $stderr); my $result =3D IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr; + $stdout =3D~ s/\r\n/\n/g if $Config{osname} eq 'msys'; + $stderr =3D~ s/\r\n/\n/g if $Config{osname} eq 'msys'; chomp($stdout); chomp($stderr); return ($stdout, $stderr); @@ -878,6 +880,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; } @@ -909,6 +912,7 @@ sub command_like_safe $stderr =3D slurp_file($stderrfile); 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 +934,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; } @@ -981,12 +986,14 @@ sub command_checks_all # check stdout for my $re (@$out) { + $stdout =3D~ s/\r\n/\n/g if $Config{osname} eq 'msys'; like($stdout, $re, "$test_name stdout /$re/"); } =20 # check stderr for my $re (@$err) { + $stderr =3D~ s/\r\n/\n/g if $Config{osname} eq 'msys'; like($stderr, $re, "$test_name stderr /$re/"); } =20 --QY4Df8rCVkcTFZsU-- --logTrinR5QSRBE0P Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmFD5QkACgkQnvQgOdby QH2+DQ//VrqVlLLq5rRcmgZEZfHIsGeRF++8EnHpWYATfP/DBdxY4O7CO82dPo28 YMqarbfJ+pyoQ5LiU3KfWFOjNHaDoA78xsQNCSjiYvD5YO1/MyWb8R3SKYMtZI/0 +oPtIYI5AAjFlrTFu+N3WqngrgsTd+q+rR25Z/l6Y4CmkdlBHkxwtYGso7ttIu1z Se9FeStgBOdOaJqpN3xvUiJ64y9gHfKavwkrRgD5DftQcA7QxsjXlI1gPYq7vKXh SLg6yRw6roacvIFT+HUhsE2wyu5EWORYqp5vscK+eLB4+idOyb5ryOvJXh02ER2J nAJBOSX7fOprwQlYMwgDBflMPYXms6jrk81sa6lfbKkoQfqevDxYMaTT3WDkWYTy F6pdG4pUKRW3XgZyt2x/jTkO5WZVihIl/bIsfBYHcVEM5/WE3+JyJYlwwsBg2fRY plPr8+hH/f5R3skjCSqISnoM5FGL/1cirZFPLR9uTp3NBm35Y5tmeapFWv1/u2jB tWMxwKtfNHxwu8/rVjRsGV/FBDY9DSgL9W7jMvrL5SZA6J3qRLJdb3m7+aF1e3hO LmDiFfDDjaB/xGm07k6CE0mO9Pzs0YRX4Su9fcsa09TJvFQ3v2GrqYlacVtJO2PL 9fFmXTjnrK+nJ2l7ABseAAgIW1Yaj6/Vq+fGFVFAL38ZPeS7ZdQ= =xFx7 -----END PGP SIGNATURE----- --logTrinR5QSRBE0P--