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 1nKxY3-0006kO-Rr for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Feb 2022 07:19:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nKxY2-0006yT-OL for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Feb 2022 07:19:22 +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 1nKxY2-0006yJ-FB for pgsql-hackers@lists.postgresql.org; Fri, 18 Feb 2022 07:19:22 +0000 Received: from mail-qv1-xf31.google.com ([2607:f8b0:4864:20::f31]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nKxXv-0001d1-Sm for pgsql-hackers@postgresql.org; Fri, 18 Feb 2022 07:19:21 +0000 Received: by mail-qv1-xf31.google.com with SMTP id o5so13148399qvm.3 for ; Thu, 17 Feb 2022 23:19:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=B49GVRsziNy14tckzDcqoJA0kSgDS7OHDlIwBOVlu00=; b=OSrsTwBFcyAhV8gl0/zOWH0+RQRabqDlu+TwutvWQElno8XjlkRYqBQ8IekbXB1lq7 JnHPbdkh6Np+CnKj0MTyghOF4GNDT1uYzOKNXsbsgnZV8OUYSMqRRX/FkURaHcQjTCne e73Mun7n/SIMjruSqTSyUZZRRF6QgkWZvMfKQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=B49GVRsziNy14tckzDcqoJA0kSgDS7OHDlIwBOVlu00=; b=GM+FdSpgtLiH4QjRAuY8x1SYJiYBem+AE19ZpfeKHygHDBd1dRCn9VGY0+tO1Dg6q8 mXD2mziMQmcd1izMDbWr1mkZg28korEqK+LmaqF0c5M/Q2j/B3AgV4gsxhJcGGJA9+xt svR/nbi8g/tIpHdvJ6Fsmz8DZguV87kTVud4gJiRrLzApcppXyXv5e8yy5leU+PTSQ6D 9SQLpr2mN/tOwZA5o9OwtIQe0LQFwWI4aIw2cN8Al8JVx5fgnYcbPCKIJlnuWGGieXSv c/uCTdBkDaR44hqS9/HRwL5nM9/2jOptzTdIxDIIa3oMMxQ51kX7B5ehknM4BoGWS4q2 EPVw== X-Gm-Message-State: AOAM533JT49nuiEntfWDqORLYCHTJOxxAwe6PTvbpj+CVzzg+9ZwdY1j GTb4t8hj06UnqSbBvvYbLmyg6g== X-Google-Smtp-Source: ABdhPJyLoXsBZjqpKewROmEjM3xAE/US17kJIhLqGRM9dUGhGKZabqNxs9vXOie8CdS1WWY6+Nao2g== X-Received: by 2002:a05:622a:1183:b0:2dd:7c52:c0c2 with SMTP id m3-20020a05622a118300b002dd7c52c0c2mr3530675qtk.578.1645168754539; Thu, 17 Feb 2022 23:19:14 -0800 (PST) Received: from rfd.leadboat.com ([2600:1702:a20:5750::2e]) by smtp.gmail.com with ESMTPSA id j15sm25527453qta.83.2022.02.17.23.19.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Feb 2022 23:19:14 -0800 (PST) Date: Thu, 17 Feb 2022 23:19:11 -0800 From: Noah Misch To: Andres Freund Cc: pgsql-hackers@postgresql.org Subject: Re: Timeout control within tests Message-ID: <20220218071911.GB3506226@rfd.leadboat.com> References: <20220218052842.GA3627003@rfd.leadboat.com> <20220218054825.vhoiv2f7vgwdsnnb@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220218054825.vhoiv2f7vgwdsnnb@alap3.anarazel.de> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Feb 17, 2022 at 09:48:25PM -0800, Andres Freund wrote: > On 2022-02-17 21:28:42 -0800, Noah Misch wrote: > > I propose to have environment variable PG_TEST_TIMEOUT_DEFAULT control the > > timeout used in the places that currently hard-code 180s. > > Meson's test runner has the concept of a "timeout multiplier" for ways of > running tests. Meson's stuff is about entire tests (i.e. one tap test), so > doesn't apply here, but I wonder if we shouldn't do something similar? Hmmm. It is good if the user can express an intent that continues to make sense if we change the default timeout. For the buildfarm use case, a multiplier is moderately better on that axis (PG_TEST_TIMEOUT_MULTIPLIER=100 beats PG_TEST_TIMEOUT_DEFAULT=18000). For the hacker use case, an absolute value is substantially better on that axis (PG_TEST_TIMEOUT_DEFAULT=3 beats PG_TEST_TIMEOUT_MULTIPLIER=.016666). > That > way we could adjust different timeouts with one setting, instead of many > different fobs to adjust? I expect multiplier vs. absolute value doesn't change the expected number of settings. If this change proceeds, we'd have three: PG_TEST_TIMEOUT_DEFAULT, PGCTLTIMEOUT, and PGISOLATIONTIMEOUT. PGCTLTIMEOUT is separate for conceptual reasons, and PGISOLATIONTIMEOUT is separate for historical reasons. There's little use case for setting them to unequal values. If Meson can pass down the overall timeout in effect for the test file, we could compute all three variables from the passed-down value. Orthogonal to Meson, as I mentioned, we could eliminate PGISOLATIONTIMEOUT. timeouts.spec used to have substantial timeouts that had to elapse for the test to pass. (Commit 741d7f1 ended that era.) A multiplier would have been a good fit for that use case. If a similar test came back, we'd likely want two multipliers, a low one for elapsing timeouts and a high one for non-elapsing timeouts. A multiplier of 10-100 is reasonable for non-elapsing timeouts, with the exact value being irrelevant on the buildfarm. Setting an elapsing timeout higher than necessary causes measurable waste. One could argue for offering both a multiplier variable and an absolute-value variable. If there's just one variable, I think the absolute-value variable is more compelling, due to the aforementioned hacker use case. What do you think?