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 1lwbY2-00020v-Fl for pgsql-committers@arkaria.postgresql.org; Fri, 25 Jun 2021 02:26:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lwbY1-0004RF-1w for pgsql-committers@arkaria.postgresql.org; Fri, 25 Jun 2021 02:26:25 +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 1lwbY0-0004R5-Sc for pgsql-committers@lists.postgresql.org; Fri, 25 Jun 2021 02:26:24 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwbXy-0004oj-5H for pgsql-committers@lists.postgresql.org; Fri, 25 Jun 2021 02:26:24 +0000 Received: (Authenticated sender: adsend@dunslane.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 48E5AC0002; Fri, 25 Jun 2021 02:26:19 +0000 (UTC) Subject: Re: pgsql: Fix pattern matching logic for logs in TAP tests of pgbench From: Andrew Dunstan To: Michael Paquier Cc: pgsql-committers@lists.postgresql.org References: <0f49303e-7784-b3ee-200b-cbf67be2eb9e@dunslane.net> Message-ID: <4a58ca30-7d79-8005-b427-9e73f004f457@dunslane.net> Date: Thu, 24 Jun 2021 22:26:18 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <0f49303e-7784-b3ee-200b-cbf67be2eb9e@dunslane.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/24/21 10:12 PM, Andrew Dunstan wrote: > On 6/24/21 9:53 PM, Michael Paquier wrote: >> On Thu, Jun 24, 2021 at 09:36:53PM -0400, Andrew Dunstan wrote: >>> That's not really an equivalent test. I'm taking a look >> Thanks! > > > > There's a whole lot wrong with this code. To start with, why is that > unchecked eval there. And why is it reading in log files on its own > instead of using TestLib::slurp_file, which, among other things, > normalizes line endings? There's a very good chance that this latter is > the issue. It only affects msys which is why you didn't see an issue on > MSVC. And also, why does it carefully unlink the log files so that any > trace of what's gone wrong is deleted? > > > Based on the little I've seen this file needs a serious code review. ... and there's the error: check_pgbench_logs($bdir, '001_pgbench_log_2', 1, 8, 92,     qr{^[01] \d{1,2} \d+ \d \d+ \d+$}); and one further down the same. Since the file isn't read in using slurp_file, that $ won't match because the lines will end \r\n instead of \n. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com