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 1mIWf3-0004Vt-OU for pgsql-committers@arkaria.postgresql.org; Tue, 24 Aug 2021 13:40:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mIWf0-0000oz-Uk for pgsql-committers@arkaria.postgresql.org; Tue, 24 Aug 2021 13:40:14 +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 1mIWf0-0000op-6g for pgsql-committers@lists.postgresql.org; Tue, 24 Aug 2021 13:40:14 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mIWew-0000Li-It for pgsql-committers@lists.postgresql.org; Tue, 24 Aug 2021 13:40:12 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 66AA33200938; Tue, 24 Aug 2021 09:40:07 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 24 Aug 2021 09:40:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=VndhdpkOXPK1VMXvtCaSgZeRYD1WTHeaGjCqLodA3 68=; b=cus+Jhwre8yS6aS1i8yMAIRjDxl5CNN49M0XkLTmtheTVHMp1zUzEG0i5 hzkIr9QbCGPIUAfAoMsnikNCd0+tDJelve4YXnFsqT5Iui2m9AG7ivE19xnGK0pm qF5zhtj90Bvd/E320CTf5PkgoHKyml9CY4bg+GmT62NoQ/U8JtPxyj2mmHn1pdUk 4CfyekLWAfkbUCM/h3Pu6sJZm0z7kUz3Tykzc47vnkl+KUTS8JOJsMJrOkMsQnQt qArGZ7fCtt/FgJJ3AazRkKOvF2uULQRTmjGMdjYJvw5prraoEBD61UZ1fCurQQHc hcoTlJzgaKWAYZ0tfB4RYOI1dB/vA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddtjedgieejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvg hrphhrihhsvggusgdrtghomheqnecuggftrfgrthhtvghrnhepkeehieehvdegueeghfff ueeliedvgfeigffhheevvdegfefgfeetgeejudejjeehnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgruhht segvnhhtvghrphhrihhsvggusgdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Aug 2021 09:40:04 -0400 (EDT) Subject: Re: pgsql: psql: Add test for query canceling To: Daniel Gustafsson , Tom Lane Cc: Fabien COELHO , pgsql-committers@lists.postgresql.org References: <5F16EBAA-30D3-4C0D-840C-C2FF2739E370@yesql.se> <1957503.1629485278@sss.pgh.pa.us> <1983764.1629499242@sss.pgh.pa.us> From: Peter Eisentraut Message-ID: <973f7e4c-bf02-86f3-9909-988046b9362e@enterprisedb.com> Date: Tue, 24 Aug 2021 15:40:02 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 23.08.21 13:12, Daniel Gustafsson wrote: >> On 21 Aug 2021, at 00:40, Tom Lane wrote: >> >> Daniel Gustafsson writes: >>> On 20 Aug 2021, at 20:47, Tom Lane wrote: >>>> I think you should drop the overly-cute bit with a SIGALRM handler, >>>> and instead have a loop-with-delay around an attempt to read the >>>> psql.pid file, after launching the psql run without an immediate >>>> wait for termination. >> >>> This could perhaps be done with a PostgresNode::interactive_psql >>> session? >> >> Yeah, we do have that infrastructure available in the >> 010_tab_completion.pl test. > > In order to satisfy my own curiosity I decided to take a stab at this which > turned into the attached. I wasn’t able to reliably know that the pg_sleep > query had started except letting the timer expire, but that may very well be > the rust on my Perl skills showing. Thanks for looking into this. With your patch applied, tests 2, 3, and 4 fail. Do they pass for you?