From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id CI/TK5bNi2ATYAAAWB0awg (envelope-from ) for ; Fri, 30 Apr 2021 05:27:50 -0400 Received: by simark.ca (Postfix, from userid 112) id B1B0C1F11C; Fri, 30 Apr 2021 05:27:50 -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 EE40E1E783 for ; Fri, 30 Apr 2021 05:27:49 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AB9F839D3D25; Fri, 30 Apr 2021 09:27:49 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 611DE39AE40E for ; Fri, 30 Apr 2021 09:27:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 611DE39AE40E 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 87B0EB28A for ; Fri, 30 Apr 2021 09:27:46 +0000 (UTC) Date: Fri, 30 Apr 2021 11:27:44 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Make gdb.mi/mi-sym-info.exp more robust against timeouts Message-ID: <20210430092743.GA24286@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" 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