From: tdevries <tdevries@suse.de>
To: Luis Machado <luis.machado@linaro.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [committed][gdb/testsuite] Make gdb.mi/mi-sym-info.exp more robust against timeouts
Date: Fri, 30 Apr 2021 15:05:31 +0200 [thread overview]
Message-ID: <65f0b3e8fed24d2a5a9593977d80f4db@suse.de> (raw)
In-Reply-To: <1c7ee1d2-9ff0-645c-3a0e-b6d1ed3f328f@linaro.org>
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 <tdevries@suse.de>
>>
>> * 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
>>
next prev parent reply other threads:[~2021-04-30 13:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-30 9:27 Tom de Vries
2021-04-30 12:55 ` Luis Machado via Gdb-patches
2021-04-30 13:05 ` tdevries [this message]
2021-04-30 13:06 ` Simon Marchi via Gdb-patches
2021-04-30 13:20 ` Luis Machado via Gdb-patches
2021-04-30 13:28 ` Simon Marchi via Gdb-patches
2021-04-30 13:34 ` Luis Machado via Gdb-patches
2021-04-30 13:41 ` Simon Marchi via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=65f0b3e8fed24d2a5a9593977d80f4db@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=luis.machado@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox