From patchwork Fri Sep 23 14:17:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 57973 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B862A385734C for ; Fri, 23 Sep 2022 14:18:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B862A385734C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1663942739; bh=zOBE1g8c5Fzt/6X675GvXHAyIdSlZ5sxYFl6syBrTHE=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Skhd68d/pkStLqW5lsgz3uohQdCU2mjp83ypqG6VOBt++12Rb/Pnkk8GR4iy0ako+ 9zxKlQ0WteUSe2r6tW4vqQgAOrg4CHy5OH3LCjoQgwVj2+p4bqUPS5hNAp+skpNQPE Ux/5pMYcmPItAEXT13TKzv6f2eIp/sYA8cnVi5t0= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 813683857BA2 for ; Fri, 23 Sep 2022 14:18:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 813683857BA2 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 28NEI2ls001489 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Sep 2022 10:18:07 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 28NEI2ls001489 Received: from simark.localdomain (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id D447A1E110; Fri, 23 Sep 2022 10:18:02 -0400 (EDT) To: gdb-patches@sourceware.org Subject: [PATCH 1/3] gdb/testsuite: bump duration for the whole test in do_self_tests Date: Fri, 23 Sep 2022 10:17:59 -0400 Message-Id: <20220923141801.1106678-2-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220923141801.1106678-1-simon.marchi@polymtl.ca> References: <20220923141801.1106678-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 23 Sep 2022 14:18:02 +0000 X-Spam-Status: No, score=-3190.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Simon Marchi via Gdb-patches From: Simon Marchi Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" When running gdb.gdb/python-helper.exp, I get some timeouts: continue Continuing. print 1 FAIL: gdb.gdb/python-helper.exp: hit breakpoint in outer gdb (timeout) At this time, GDB is actually processing the stop and reading in some CUs. selftest_setup does bump the timeout, but it's not for the whole test. Since debugging GDB with GDB is (unfortunately) a bit slow, bump the timeout for the whole duration of the setup and body. On my optimized build, the command takes just a bit more than the current timeout of 10 seconds. But it's much slower if running the test on an unoptimized build, so I think it's necessary to bump the timeout for that in any case. Change-Id: I4d38285870e76c94f9d0bfdb60648a2e7f2cfa5d --- gdb/testsuite/lib/selftest-support.exp | 36 ++++++-------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp index 138afc0df568..2b17c539a96f 100644 --- a/gdb/testsuite/lib/selftest-support.exp +++ b/gdb/testsuite/lib/selftest-support.exp @@ -45,29 +45,14 @@ proc find_gdb { arg } { proc selftest_setup { executable function } { global gdb_prompt - global timeout global INTERNAL_GDBFLAGS # load yourself into the debugger - # This can take a relatively long time, particularly for testing where - # the executable is being accessed over a network, or where gdb does not - # support partial symbols for a particular target and has to load the - # entire symbol table. Set the timeout to 10 minutes, which should be - # adequate for most environments (it *has* timed out with 5 min on a - # SPARCstation SLC under moderate load, so this isn't unreasonable). - # After gdb is started, set the timeout to 30 seconds for the duration - # of this test, and then back to the original value. - - set oldtimeout $timeout - set timeout 600 - verbose "Timeout is now $timeout seconds" 2 global gdb_file_cmd_debug_info set gdb_file_cmd_debug_info "unset" set result [gdb_load $executable] - set timeout $oldtimeout - verbose "Timeout is now $timeout seconds" 2 if { $result != 0 } then { return -1 @@ -85,9 +70,6 @@ proc selftest_setup { executable function } { } # run yourself - # It may take a very long time for the inferior gdb to start (lynx), - # so we bump it back up for the duration of this command. - set timeout 600 set description "run until breakpoint at $function" gdb_test_multiple "run $INTERNAL_GDBFLAGS" "$description" { @@ -99,21 +81,14 @@ proc selftest_setup { executable function } { } -re "vfork: No more processes.*$gdb_prompt $" { fail "$description (out of virtual memory)" - set timeout $oldtimeout - verbose "Timeout is now $timeout seconds" 2 return -1 } -re ".*$gdb_prompt $" { fail "$description" - set timeout $oldtimeout - verbose "Timeout is now $timeout seconds" 2 return -1 } } - set timeout $oldtimeout - verbose "Timeout is now $timeout seconds" 2 - return 0 } @@ -159,9 +134,14 @@ proc do_self_tests {function body} { gdb_start set file [remote_download host $GDB_FULLPATH $xgdb] - set result [selftest_setup $file $function] - if {$result == 0} then { - set result [uplevel $body] + # When debugging GDB with GDB, some operations can take a relatively long + # time, especially if the build is non-optimized. Bump the timeout for the + # duration of the test. + with_timeout_factor 10 { + set result [selftest_setup $file $function] + if {$result == 0} then { + set result [uplevel $body] + } } gdb_exit