Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp2434024ybj; Mon, 23 Sep 2019 03:52:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwL5aiEKEdD7oj+m1Sagx3pCQ3coe+8rx+eCMhM37t2eGtBa5TkV9xysxXP7FJsYW/bum1D X-Received: by 2002:a17:906:ecf6:: with SMTP id qt22mr5213190ejb.212.1569235946912; Mon, 23 Sep 2019 03:52:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569235946; cv=none; d=google.com; s=arc-20160816; b=NHSkG/QtI1qq52X1gOCsjXQZWteB1Na6KMqzu1H+QBKyf1dgft4TOUhUq62wKOCHNL t4580hz9/DwuSntaiyV8y9+Hd0pl1Dlc+M7URARXYbLqYNOcEquP+ODFPqoRbB+2A2xb TqTO0SS/1q43AkZJmzOcKAVxnaSgAcHj80cYfnAuMndLigmFEYyjagxBoww60lC+Opgm gDiWl0t35BnkbEE8B9yp8iDcuD5kaIIwMaw2PYA2cJBIM06EbU1XZSL+VYR+xbuICjN/ DYmBTdGu83pim4BVkcWQq2DUFmjxGEmJs6OYRYDPZ0HZI730uR/pfhI2ePMCUQbg+OoE J6JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=ZJoUGRykAhm8wa+mrUIi4CW2y6WvkPJwfP4/4UKShhg=; b=F1jMcjpBybkgfLSp06PV/yWF5AMcW0UUJdFKMIeO0i0cxc+7vEqZHYs68cXPdtzI97 ZFYhIrdoDjviZEa2SOjIHfA7cWb+MJG2QbDl8xLXJiDNferRgLb6COGlbX30+wbBvyax 2Vw6WUUCnb+3j6xKJO3ZfxLNBCYfJRQoOKtAjNRo3MrCcnSHNsyB107lMgA1CQsGdG7n zomSkhJHP82NaqERZj3z+Ey+NXAA7FiSeXiG6ZjszwMATSxRR9YWVoC1FudO2z2Aw56d Kz1u4xQ5rr7DYiQBp6YawCE+hDD3CysAHcXTAdE7yRQGYC9mrLnWTabpR9Mj2cadDw5w vmQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UmZGcPEd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e23si6314700edq.344.2019.09.23.03.52.03; Mon, 23 Sep 2019 03:52:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UmZGcPEd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729977AbfITUYS (ORCPT + 99 others); Fri, 20 Sep 2019 16:24:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:46406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729813AbfITUYR (ORCPT ); Fri, 20 Sep 2019 16:24:17 -0400 Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 09F25208C0; Fri, 20 Sep 2019 20:24:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569011056; bh=sFaOmPWJj56dw23yebZSt8SnxXqc2hBvrsUugoPL25Q=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=UmZGcPEdScVMJng+U+b1z9/fAJWTq0QakOKggHWZdNgnn6gE4whIVhLDV5slrJZ5f lZhGNAoWzTJ8usrGfQNCKPBOhKYlVxxj8POQjOF3o9v/migT+y19hkwhgUJRlw0zE4 Bh6ZOtjlo6/CY+ABv2d7VRONpOGZhnjFNyu+OWnE= Subject: Re: [PATCH] selftests/kselftest/runner.sh: Add 45 second timeout per test To: Kees Cook Cc: Alexandre Belloni , Anders Roxell , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah References: <201909191102.97FA56072@keescook> <20190919185525.GD21254@piout.net> <4844c68f-603d-14f2-f976-5bd255268c0d@kernel.org> <201909191411.3FA57CBCF3@keescook> From: shuah Message-ID: Date: Fri, 20 Sep 2019 14:24:04 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201909191411.3FA57CBCF3@keescook> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/19/19 3:17 PM, Kees Cook wrote: > On Thu, Sep 19, 2019 at 02:09:37PM -0600, shuah wrote: >> On 9/19/19 12:55 PM, Alexandre Belloni wrote: >>> On 19/09/2019 11:06:44-0700, Kees Cook wrote: >>>> Commit a745f7af3cbd ("selftests/harness: Add 30 second timeout per >>>> test") solves the problem of kselftest_harness.h-using binary tests >>>> possibly hanging forever. However, scripts and other binaries can still >>>> hang forever. This adds a global timeout to each test script run. >>>> >> >> Timeout is good, but really tests should not hang. So we have to somehow >> indicate that the test needs to be fixed. > > Totally agreed, which is why I changed the reporting to call out a > "TIMEOUT" instead of just having it enter the general failure noise. > >> This timeout is a band-aid and not real solution for the problem. This >> arbitrary value doesn't take into account that the test(s) in that >> particular directory (TARGET) could be running normally and working >> through all the tests. > > Even something that looks like it's making progress may still be hung or > won't finish in a reasonable amount of time. > >> We need some way to differentiate the two cases. > > I don't think it's unreasonable to declare that no test should take > longer than some default amount of time that can be tweaked via a > "settings" file. It gives the framework the option of easily removing > tests that take "too long", etc. If the "timeout=..." value was made > mandatory for each test directory, then the framework could actually > filter based on expected worst-case run time. > >>>> To make this configurable (e.g. as needed in the "rtc" test case), >>>> include a new per-test-directory "settings" file (similar to "config") >>>> that can contain kselftest-specific settings. The first recognized field >>>> is "timeout". >>>> >>> >>> Seems good to me. I was also wondering whether this is actually >>> reasonable to have tests running for so long. I wanted to discuss that >>> at LPC but I missed the session. >>> >> >> There is the individual test times and overall kselftest run time. We >> have lots of tests now and it does take long. > > This patch seeks to implement a "timeout for a single test from > kselftest's perspective". Some "individual" tests have many subtests > (e.g. anything built with kselftest_harness.h) giving us the whole > subtest issue. I think my solution here is a good middle ground: we > specify the max run time for each executed test binary/script. > > It's not clear to me if a v2 is needed? Is this patch fine as-is? > > Thanks! > v1 is good. I will pull this in for testing. I do like the way it is done. thanks, -- Shuah