From patchwork Tue Dec 12 14:04:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 177419 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp7808600vqy; Tue, 12 Dec 2023 07:41:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IEvh4jFoikuy5HysH487eAB3a8Ox7DQnp7zeIrIS/PnCzTS6Ulzgn0rDJN9bwExRbdZ1zSb X-Received: by 2002:a05:620a:27d4:b0:77d:88eb:d722 with SMTP id i20-20020a05620a27d400b0077d88ebd722mr4922299qkp.35.1702395666267; Tue, 12 Dec 2023 07:41:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702395666; cv=pass; d=google.com; s=arc-20160816; b=AcNhDgvFy8eySWwte1WFHuPHjjIpHcdk9xmxIMQ9L5zdx7+yVCZ0lVGeK9HwpWj0JX fnqH5VcARPnnIzI764Uml4e9MCt/aQ61XaPI97Bew+dWok1Z01hmmu62yBXs0vbAAHg5 Q6c1kT5AHoyj6Wy29bAzo8vVn6GFV/jilQQS8lkWSEjFEkZG3ns15J8itXefZMoO8sXo a0WecVtnf9jNPGNPJC4o01K0BkV5duc0ZowVqSkV8bx6pw+X9qRBW37P1FWBcckgPMXI g2nBqN+wh1WNVrZxYOpXyohMdJvt+3JYOKwzq8J5de07w1beF24CczivqsabLyS3gkc9 Xf4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:user-agent :references:message-id:in-reply-to:subject:to:from:date :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=ZAhZziJboldSoUto+hUxQNlU0yMzPkfXR3X3/tb/tK4=; fh=l9KIAcfdl/h/gHLXvAPZfpjKRu13z7SjLL4pnqa2HQg=; b=Ei79n8VcckXEuicI/mRnOzEMgbV+PdEEsU8pzzOrAvTc5IdL4Q6MtjTHJNrEDmpcdz siKMuReoFeTBKRHOTleHFLBlejBv9UjXtC3FtwKOYvGXR3xSwM4o7iSph/mr0lOmU48H j6jVjU7T6tD8xXiQXYXyKn+qGYvnUmGhvaczmljD0ocCUbCiB/1kXD73w8BB/TKIJVow K8zUlztN+dzixBOuusF7SREuDXiVrYL7Qp3IMoRzKbhmcQ5WE88FLN0WRePz407DII3X LEMsGUXXwWeqfti/9UuDabwQ4/PxSYHFTQm6vIMRIJ/SACaStC7u4vgK5Y7LdigwBn61 CUSw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=C+Ova8aM; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id bs33-20020a05620a472100b0077f3740c2c3si11655458qkb.267.2023.12.12.07.41.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 07:41:06 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=C+Ova8aM; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9AA4E385C420 for ; Tue, 12 Dec 2023 14:05:23 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 62B13385802A for ; Tue, 12 Dec 2023 14:04:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 62B13385802A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 62B13385802A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::62d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702389887; cv=none; b=xUir0cXnc0g5AykNvWID4InwAku3fIZiaaK0PoqMoPuckGRTa3vMGzTLtVSSLDsLIhd5Wd/yVCw9E0Rjy/gnSnV5GVgJ0mI1CE4vuFXvQUit98idnQKPmVOlJdKiVNMohgevHtOAbYAQSyxiMtx0G3zdJvMqXq+P3fkIcNgLeDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702389887; c=relaxed/simple; bh=KePfZLJ3B3t3++RAYc7pdXXCfFZckkxvMXAoPOcdtkc=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=AlKiYCRKCpgex59wyVxDQ5XEYEUU9CXlz6kP0evtMU8A1PuqgqGor5v08da++VZE7mdghgmbiXeBXkwPnZNwqkmfvcyqlyPWK15O/ZahJfY/qO1/rePd8AgFmF8BGntzCuttod5JBpUCppS5V2p+WWLSDIj6cBWm4bGB/wXXx/k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a1db99cd1b2so709541866b.2 for ; Tue, 12 Dec 2023 06:04:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1702389876; x=1702994676; darn=gcc.gnu.org; h=mime-version:user-agent:references:message-id:in-reply-to:subject :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ZAhZziJboldSoUto+hUxQNlU0yMzPkfXR3X3/tb/tK4=; b=C+Ova8aMM/llZmePR7/jgaRM9uS615LwK454LtsVwEqsonO8eXs6OorsBM5E5nviSR wVINB8Wus6eY3T2cuBJrsF45TO8U8s3q5kvyWVtLwGM6cnfEoEqgnbwOy6Jhj0MXmqKr 2kXJwXIvS/IRhYJG8tmeFkPifl7NsN2nW3Z4HGefZZOtnbz7nUAi7O8+CLgglGO95fVU v0tZY6v4CwFQY4cl65wH8kPJJOsJHQweagfMYegYMyDTxORPnbR2rFrXXq9PEKSCdvcx UB/3yx+Jay2hV+lByZiBPXc2uEjlg7i7CxJcsWeWfdsfeXPjWoY5rCxPRulp77l2+4cd dLxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702389876; x=1702994676; h=mime-version:user-agent:references:message-id:in-reply-to:subject :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZAhZziJboldSoUto+hUxQNlU0yMzPkfXR3X3/tb/tK4=; b=T7SBnMD0kEF2HxQgqeMCss7p1ukpZmnpcSmfsvX82Jop16pGlIPCfr1NuNZjDvUT32 Vtg57HRQedQy4X/NDYBo33XtMfAVEjSUDSfor5XNsZjLUbU1EoP0Gc4Txm6+dyYm0ug+ FHxJrlQEI+E43CF7NcDE9qFFSTfosnnXi6DH13YZhDfg/qepRviqn/Ums5WLQidRsVPu 6BiCNi9neYxoH/RWHil2tt1Ybhumii8Bn9upjUEg1Ekc/7TiZPK/lYeyYeyA+fLVRDbM 0W1w3J78/0pWv75T9D5axwmADvhvrVhTSo+SBh0cH5BnUKTwRmHam1X1Phprtg/la4ge BO/g== X-Gm-Message-State: AOJu0Yzvbqkbgatewv+PuNe2diZKOH3Y4T4JqvjfmDH/ZCLhgTF7BMOx xmraLtwDUm/YuxZdrfVCvSOFKA== X-Received: by 2002:a17:906:10cf:b0:a22:e619:4719 with SMTP id v15-20020a17090610cf00b00a22e6194719mr380431ejv.35.1702389875924; Tue, 12 Dec 2023 06:04:35 -0800 (PST) Received: from tpp.orcam.me.uk (tpp.orcam.me.uk. [81.187.245.177]) by smtp.gmail.com with ESMTPSA id rf20-20020a1709076a1400b00a1d1b8a088esm6316824ejc.92.2023.12.12.06.04.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Dec 2023 06:04:35 -0800 (PST) Date: Tue, 12 Dec 2023 14:04:33 +0000 (GMT) From: "Maciej W. Rozycki" To: dejagnu@gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH DejaGNU 1/1] Support per-test execution timeout factor In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785085183973856427 X-GMAIL-MSGID: 1785091237941328960 Add support for the `test_timeout_factor' global variable letting a test case scale the wait timeout used for code execution. This is useful for particularly slow test cases for which increasing the wait timeout globally would be excessive. * baseboards/qemu.exp (qemu_load): Handle `test_timeout_factor'. * config/gdb-comm.exp (gdb_comm_load): Likewise. * config/gdb_stub.exp (gdb_stub_load): Likewise. * config/sim.exp (sim_load): Likewise. * config/unix.exp (unix_load): Likewise. * doc/dejagnu.texi (Local configuration file): Document `test_timeout_factor'. --- baseboards/qemu.exp | 4 ++++ config/gdb-comm.exp | 4 ++++ config/gdb_stub.exp | 4 ++++ config/sim.exp | 4 ++++ config/unix.exp | 4 ++++ doc/dejagnu.texi | 10 +++++++++- 6 files changed, 29 insertions(+), 1 deletion(-) dejagnu-test-timeout-factor.diff Index: dejagnu/baseboards/qemu.exp =================================================================== --- dejagnu.orig/baseboards/qemu.exp +++ dejagnu/baseboards/qemu.exp @@ -200,11 +200,15 @@ proc qemu_load { dest prog args } { global qemu global timeout global test_timeout + global test_timeout_factor set wait_timeout $timeout if {[info exists test_timeout]} { set wait_timeout $test_timeout } + if {[info exists test_timeout_factor]} { + set wait_timeout [expr $wait_timeout * $test_timeout_factor] + } verbose -log "Executing on $dest: $prog (timeout = $wait_timeout)" 2 Index: dejagnu/config/gdb-comm.exp =================================================================== --- dejagnu.orig/config/gdb-comm.exp +++ dejagnu/config/gdb-comm.exp @@ -254,6 +254,7 @@ proc gdb_comm_load { dest prog args } { global GDBFLAGS global gdb_prompt global test_timeout + global test_timeout_factor set argnames { "command-line arguments" "input file" "output file" } for { set x 0 } { $x < [llength $args] } { incr x } { @@ -274,6 +275,9 @@ proc gdb_comm_load { dest prog args } { } else { set testcase_timeout 300 } + if {[info exists test_timeout_factor]} { + set testcase_timeout [expr $testcase_timeout * $test_timeout_factor] + } verbose -log "Executing on $dest: $prog (timeout = $testcase_timeout)" 2 Index: dejagnu/config/gdb_stub.exp =================================================================== --- dejagnu.orig/config/gdb_stub.exp +++ dejagnu/config/gdb_stub.exp @@ -471,6 +471,7 @@ proc gdb_stub_wait { dest timeout } { } proc gdb_stub_load { dest prog args } { + global test_timeout_factor global test_timeout global gdb_prompt set argnames { "command-line arguments" "input file" "output file" } @@ -485,6 +486,9 @@ proc gdb_stub_load { dest prog args } { if {[info exists test_timeout]} { set wait_timeout $test_timeout } + if {[info exists test_timeout_factor]} { + set wait_timeout [expr $wait_timeout * $test_timeout_factor] + } verbose -log "Executing on $dest: $prog (timeout = $wait_timeout)" 2 Index: dejagnu/config/sim.exp =================================================================== --- dejagnu.orig/config/sim.exp +++ dejagnu/config/sim.exp @@ -60,6 +60,7 @@ proc sim_wait { dest timeout } { } proc sim_load { dest prog args } { + global test_timeout_factor global test_timeout set inpfile "" @@ -82,6 +83,9 @@ proc sim_load { dest prog args } { } else { set sim_time_limit 240 } + if {[info exists test_timeout_factor]} { + set sim_time_limit [expr $sim_time_limit * $test_timeout_factor] + } set output "" Index: dejagnu/config/unix.exp =================================================================== --- dejagnu.orig/config/unix.exp +++ dejagnu/config/unix.exp @@ -33,6 +33,7 @@ load_lib remote.exp proc unix_load { dest prog args } { + global test_timeout_factor global ld_library_path global test_timeout set output "" @@ -42,6 +43,9 @@ proc unix_load { dest prog args } { if {[info exists test_timeout]} { set wait_timeout $test_timeout } + if {[info exists test_timeout_factor]} { + set wait_timeout [expr $wait_timeout * $test_timeout_factor] + } if { [llength $args] > 0 } { set parg [lindex $args 0] Index: dejagnu/doc/dejagnu.texi =================================================================== --- dejagnu.orig/doc/dejagnu.texi +++ dejagnu/doc/dejagnu.texi @@ -1363,11 +1363,19 @@ by DejaGnu itself for cross testing, but to manipulate these itself. @vindex test_timeout +@vindex test_timeout_factor The local @file{site.exp} may also set Tcl variables such as @code{test_timeout} which can control the amount of time (in seconds) to wait for a remote test to complete. If not specified, @code{test_timeout} defaults to 120 or 300 seconds, depending on the -communication protocol. +communication protocol. Additionally if @code{test_timeout_factor} +Tcl variable has been set, then the amount of time to wait will be +further multiplied by the value of this variable. This multiplier +will typically be set on a test case by test case basis though rather +than in a configuration file, so that particularly slow test cases +can be given a chance to complete while preventing excessive wait +time from affecting the duration of a testsuite run if other test +cases do fail to complete. @node Board configuration file, Remote host testing, Local configuration file, Customizing DejaGnu @section Board configuration file