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 1q2JcK-0007XI-TC for pgsql-hackers@arkaria.postgresql.org; Thu, 25 May 2023 22:39:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q2JcJ-0001WL-Qm for pgsql-hackers@arkaria.postgresql.org; Thu, 25 May 2023 22:39:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q2JcI-0001Rs-DY for pgsql-hackers@lists.postgresql.org; Thu, 25 May 2023 22:39:31 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q2JcF-001tTZ-1f for pgsql-hackers@lists.postgresql.org; Thu, 25 May 2023 22:39:29 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D8D585C030C; Thu, 25 May 2023 18:39:24 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 25 May 2023 18:39:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1685054364; x=1685140764; bh=um He5dlooe7rgxcAiUunHhMn9xe1dPs0SStjpQ/51MY=; b=IQrwVGJhEqegJhXVLo tewOZH1iFDq3OBeE+yA0ys66wo6pISSjrXvg6jXvwpabQSohGc9dnvilAj0Orfyx zN0kGuuN1bRJwvhzZ7CDXVBdMElaVZuDItZzD6bn9dwqeAWqaUQdy0sjifXdUmiP XwVRgSHCsZin3I5eCKl34PT5oV0alRnHYjtanugSlgKpNrPXPrWQZy1/E1mMYirF A1PXCcvQ7+HqwB3ADPhielrl6DEI0WYz7GzVV7UOboRwP9F+WHEAaC2tG3x5Ukbg xoEZ+wyxoLsWeHi/xUb+of0mWFV2IqCjk6vBC9RsAxtH3WCbEeE+WHHGDsRMBXBB ixwQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1685054364; x=1685140764; bh=umHe5dlooe7rg xcAiUunHhMn9xe1dPs0SStjpQ/51MY=; b=ILXQ1mabZfpBkxDnnaMUobRSBqj/4 WDQxM2UwqgdQhbNQGGoW9LIB6uHkzWkFfzZmAtV/gtFEe1leOrEG+zt8C0DST+Oi P70ekZLVHPn/nrumohB3hec47uGf7p1XF4q3ILgsGMSCe08jQ8MASUm4/mnFFh5O yMCBTUCul4jJurKOCQ/QGOiy4aLWZUDVBYocie0Yi/CD+WTZFjXgduLSm83fwDBf WeH5YCVTwe7LSNW1pfyIJ3Ks8TeUNYB9twm5g6VFiSoLIlupQhGvNwUxKDru4pzQ ci50Ga0FkR24MBkdD/8g58ZqxR4TNlM8eMgF9Qzcix1shDPw3OW3tcdvQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeejkedgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddunecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepgfehhefgudefudfgfeelgeei ffegfefhkeefffdvheefuddtheetgeelteevkeetnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 25 May 2023 18:39:23 -0400 (EDT) Date: Fri, 26 May 2023 07:39:17 +0900 From: Michael Paquier To: Dagfinn Ilmari =?iso-8859-1?Q?Manns=E5ker?= Cc: vignesh C , PostgreSQL Hackers Subject: Re: Implement generalized sub routine find_in_log for tap test Message-ID: References: <87cz2otiw3.fsf@wibble.ilmari.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6uuq3SPL+598jBM5" Content-Disposition: inline In-Reply-To: <87cz2otiw3.fsf@wibble.ilmari.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --6uuq3SPL+598jBM5 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 25, 2023 at 06:34:20PM +0100, Dagfinn Ilmari Manns=E5ker wrote: > However, none of the other functions in ::Utils know anything about node > objects, which makes me think it should be a method on the node itself > (i.e. in PostgreSQL::Test::Cluster) instead. Also, I think log_contains > would be a better name, since it just returns a boolean. The name > find_in_log makes me think it would return the log lines matching the > pattern, or the position of the match in the file. >=20 > In that case, the slurp_file() call would have to be fully qualified, > since ::Cluster uses an empty import list to avoid polluting the method > namespace with imported functions. Hmm. connect_ok() and connect_fails() in Cluster.pm have a similar log comparison logic, feeding from the offset of a log file. Couldn't you use the same code across the board for everything? Note that this stuff is parameterized so as it is possible to check if patterns match or do not match, for multiple patterns. It seems to me that we could use the new log finding routine there as well, so how about extending it a bit more? You would need, at least: - One parameter for log entries matching. - One parameter for log entries not matching. -- Michael --6uuq3SPL+598jBM5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmRv45UACgkQnvQgOdby QH0giA//YG/yd/J3jPM7gSbisUJMbrwd64hOXcjsgP6bMqFM216ugVTb0iLYELUM MzHshHOQ1+basS/Q7Y2XFxqJi/WRlRE65c3MqoG08b5K0OeElJypjvK+jIbEkhDK jcuPmDotc9HyVTu8jaKNyveTETy+nTIBZ158HXnR3rbYkzoVp45isvff14zLawn5 GwUYDlaYym8p/RUZCN1HzR59LMeuF5FqqC7vJ1lo4+JPsy4nE6awkqjsA2aluyDl yiNlcgbTkGCxVlcIrw/F0vrGJ9jZRMIQw6/vWyJiRtVx8INGh0W+08TfGUJVs9ro Qub5554V7ppY2RdBePMMD5NHvxeku9/zRT1S1x+it+ie6YvDxVMZs1f+7S5jkCDN 42w1vJbp4CyyyY1wwttWaHRaaoLWsMkQXdgIAksFKhEuRZYYou65F8fwjauCrIyT /2YTTDky57+OczMyNqqq6CWALfKFZ7JLXMEIoN0egBMfLtw3wm1paZAXrI/iLXaU hUht1cg7fwg6Sa1iZihkIOKuqGgNtw2ixe3VHPEObB+heZ70EVVLBnTyAKknjCpp ZHM3oMueyDbPQ9x9YlAV64PAW+a+YlfyBEeYOgDQP+MCIU7X9uLio0sPJf/Uq17d JB5NNEOAJgdT2OEm0V0pKXw+ik0GvvLyyxxj1yTGQzE2YeAvbao= =mNZv -----END PGP SIGNATURE----- --6uuq3SPL+598jBM5--