From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 4EFDB385840C; Mon, 26 Sep 2022 21:34:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4EFDB385840C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664228055; bh=6C3zUfpCEHs/MfXvEdRgeZOjFhMSS0ahb562oDzTVJw=; h=From:To:Subject:Date:From; b=Sm0XJQsDl6TBSBfSPfElhboEABqfFBb72imCp1LvxWUB9WlDpQ6e5wNXpIf4UY+sk VM4YAY8iin9OXdftEEcEq4DMhqhhZCq/NTun3vGk08X0fY3llLi2IBGumi3HzIcw+5 O6GdjZwBiTmlIC1vURyGcp5MsYmYJFRQMo3k2/3c= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/testsuite: bump duration for the whole test in do_self_tests X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: fe441584bb9524e07dea468079d6abce859ad03c X-Git-Newrev: 687e348e720a1fcd3850324c9f0ce20b97b456b5 Message-Id: <20220926213415.4EFDB385840C@sourceware.org> Date: Mon, 26 Sep 2022 21:34:15 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D687e348e720a= 1fcd3850324c9f0ce20b97b456b5 commit 687e348e720a1fcd3850324c9f0ce20b97b456b5 Author: Simon Marchi Date: Fri Sep 23 09:45:24 2022 -0400 gdb/testsuite: bump duration for the whole test in do_self_tests =20 When running gdb.gdb/python-helper.exp, I get some timeouts: =20 continue Continuing. print 1 =20 FAIL: gdb.gdb/python-helper.exp: hit breakpoint in outer gdb (timeo= ut) =20 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. =20 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. =20 Change-Id: I4d38285870e76c94f9d0bfdb60648a2e7f2cfa5d Diff: --- 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/sel= ftest-support.exp index 138afc0df56..2b17c539a96 100644 --- a/gdb/testsuite/lib/selftest-support.exp +++ b/gdb/testsuite/lib/selftest-support.exp @@ -45,29 +45,14 @@ proc find_gdb { arg } { =20 proc selftest_setup { executable function } { global gdb_prompt - global timeout global INTERNAL_GDBFLAGS =20 # 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 n= ot - # 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 =20 global gdb_file_cmd_debug_info set gdb_file_cmd_debug_info "unset" =20 set result [gdb_load $executable] - set timeout $oldtimeout - verbose "Timeout is now $timeout seconds" 2 =20 if { $result !=3D 0 } then { return -1 @@ -85,9 +70,6 @@ proc selftest_setup { executable function } { } =20 # 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 =20 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 } } =20 - set timeout $oldtimeout - verbose "Timeout is now $timeout seconds" 2 - return 0 } =20 @@ -159,9 +134,14 @@ proc do_self_tests {function body} { gdb_start set file [remote_download host $GDB_FULLPATH $xgdb] =20 - set result [selftest_setup $file $function] - if {$result =3D=3D 0} then { - set result [uplevel $body] + # When debugging GDB with GDB, some operations can take a relatively l= ong + # time, especially if the build is non-optimized. Bump the timeout fo= r the + # duration of the test. + with_timeout_factor 10 { + set result [selftest_setup $file $function] + if {$result =3D=3D 0} then { + set result [uplevel $body] + } } =20 gdb_exit