From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id rn5zNaAAjGCBZAAAWB0awg (envelope-from ) for ; Fri, 30 Apr 2021 09:05:36 -0400 Received: by simark.ca (Postfix, from userid 112) id D3D4A1F11C; Fri, 30 Apr 2021 09:05:36 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 ESMTPS id 1AC131E813 for ; Fri, 30 Apr 2021 09:05:36 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A64293A54892; Fri, 30 Apr 2021 13:05:35 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 686033A54894 for ; Fri, 30 Apr 2021 13:05:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 686033A54894 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 751C2AF0C; Fri, 30 Apr 2021 13:05:31 +0000 (UTC) MIME-Version: 1.0 Date: Fri, 30 Apr 2021 15:05:31 +0200 From: tdevries To: Luis Machado Subject: Re: [committed][gdb/testsuite] Make gdb.mi/mi-sym-info.exp more robust against timeouts In-Reply-To: <1c7ee1d2-9ff0-645c-3a0e-b6d1ed3f328f@linaro.org> References: <20210430092743.GA24286@delia.home> <1c7ee1d2-9ff0-645c-3a0e-b6d1ed3f328f@linaro.org> User-Agent: Roundcube Webmail Message-ID: <65f0b3e8fed24d2a5a9593977d80f4db@suse.de> X-Sender: tdevries@suse.de Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit 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: , Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-04-30 14:55, Luis Machado wrote: > Wouldn't it be more reliable to do line-by-line matching instead of > sprinkling timeouts across the test? There are not many lines, but very long lines. The long lines are read in bit by bit, but it just takes a long time to start producing them. That can only be dealt with using timeouts. Thanks, - Tom > Or so I've been told. > > This doesn't seem to be an instance where GDB is taking too long, but > rather that the MI output is very verbose, right? > > On 4/30/21 6:27 AM, Tom de Vries wrote: >> Hi, >> >> Once in a while, I run into this timeout: >> ... >> FAIL: gdb.mi/mi-sym-info.exp: List all variables from debug >> information \ >> only (timeout) >> ... >> >> I can make the timeout reproducible by setting timeout to 8s (instead >> of the >> default 10s) for the duration of that test. >> >> Make the test-case more stable by fixing all timeouts caused by >> setting >> timeout to 5, either by adding with_timeout_factor, or increasing its >> factor. >> >> Tested on x86_64-linux. Also tested in parallel with stress -c 5, to >> simulate >> a busy system in another way. >> >> Committed to trunk. >> >> Thanks, >> - Tom >> >> [gdb/testsuite] Make gdb.mi/mi-sym-info.exp more robust against >> timeouts >> >> gdb/testsuite/ChangeLog: >> >> 2021-04-30 Tom de Vries >> >> * gdb.mi/mi-sym-info.exp: Add with_timeout_factor, and increase >> existing timeout factors. >> >> --- >> gdb/testsuite/gdb.mi/mi-sym-info.exp | 70 >> +++++++++++++++++++----------------- >> 1 file changed, 37 insertions(+), 33 deletions(-) >> >> diff --git a/gdb/testsuite/gdb.mi/mi-sym-info.exp >> b/gdb/testsuite/gdb.mi/mi-sym-info.exp >> index f7f574aaeae..18f85182a7b 100644 >> --- a/gdb/testsuite/gdb.mi/mi-sym-info.exp >> +++ b/gdb/testsuite/gdb.mi/mi-sym-info.exp >> @@ -55,42 +55,46 @@ set type_syms \ >> # Fetch all functions, variables and types without any non-debug >> # symbols. >> -set testname "List all functions from debug information only" >> -set cmd "111-symbol-info-functions" >> -set state 0 >> -gdb_test_multiple $cmd $testname -prompt "${mi_gdb_prompt}$" { >> - -re "111\\^done,symbols=\{debug=\\\[${symtab_re}" { >> - if { $state == 0 } { incr state } >> - exp_continue >> - } >> - -re ",${symtab_re}" { >> - exp_continue >> - } >> - -re "\\\]\}\r\n${mi_gdb_prompt}$" { >> - if { $state == 1 } { >> - pass $gdb_test_name >> - } else { >> - fail $gdb_test_name >> +with_timeout_factor 2 { >> + set testname "List all functions from debug information only" >> + set cmd "111-symbol-info-functions" >> + set state 0 >> + gdb_test_multiple $cmd $testname -prompt "${mi_gdb_prompt}$" { >> + -re "111\\^done,symbols=\{debug=\\\[${symtab_re}" { >> + if { $state == 0 } { incr state } >> + exp_continue >> + } >> + -re ",${symtab_re}" { >> + exp_continue >> + } >> + -re "\\\]\}\r\n${mi_gdb_prompt}$" { >> + if { $state == 1 } { >> + pass $gdb_test_name >> + } else { >> + fail $gdb_test_name >> + } >> } >> } >> } >> -set testname "List all variables from debug information only" >> -set cmd "112-symbol-info-variables" >> -set state 0 >> -gdb_test_multiple $cmd $testname -prompt "${mi_gdb_prompt}$" { >> - -re "112\\^done,symbols=\{debug=\\\[${symtab_re}" { >> - if { $state == 0 } { incr state } >> - exp_continue >> - } >> - -re ",${symtab_re}" { >> - exp_continue >> - } >> - -re "\\\]\}\r\n${mi_gdb_prompt}$" { >> - if { $state == 1 } { >> - pass $gdb_test_name >> - } else { >> - fail $gdb_test_name >> +with_timeout_factor 2 { >> + set testname "List all variables from debug information only" >> + set cmd "112-symbol-info-variables" >> + set state 0 >> + gdb_test_multiple $cmd $testname -prompt "${mi_gdb_prompt}$" { >> + -re "112\\^done,symbols=\{debug=\\\[${symtab_re}" { >> + if { $state == 0 } { incr state } >> + exp_continue >> + } >> + -re ",${symtab_re}" { >> + exp_continue >> + } >> + -re "\\\]\}\r\n${mi_gdb_prompt}$" { >> + if { $state == 1 } { >> + pass $gdb_test_name >> + } else { >> + fail $gdb_test_name >> + } >> } >> } >> } >> @@ -150,7 +154,7 @@ gdb_test_multiple $cmd ${testname} -prompt >> "${mi_gdb_prompt}$" { >> } >> } >> -with_timeout_factor 2 { >> +with_timeout_factor 4 { >> set testname "List all variables" >> set cmd "115-symbol-info-variables --include-nondebug" >> set state 0 >>