Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb/testsuite] Give up after consecutive timeouts in completion-support.exp
Date: Thu, 19 Mar 2020 07:58:20 +0100	[thread overview]
Message-ID: <8a23840e-60e5-2db0-93c0-55c5a3eab44a@suse.de> (raw)
In-Reply-To: <e79139f0-6a79-8c44-b340-690a0b023d21@simark.ca>

[-- Attachment #1: Type: text/plain, Size: 964 bytes --]

On 17-03-2020 16:00, Simon Marchi wrote:
> On 2020-03-17 10:53 a.m., Tom de Vries wrote:
>> Well, here's how I reasoned.
>>
>> Say for a string "abcdefgh" we test "a", "ab", "abc", etc.
>>
>> If we timeout at "a", there is the change that it's f.i. specific to
>> one-letter matches, and such timeouts will not occur of "ab" and so on.
>>
>> So, we try to establish a pattern: if "a", "ab" and "abc" timeout, then
>> we think there's a good chance that "abcd" will also timeout, and we
>> give up.
>>
>> Having said that, my reasoning above is more concerned with not testing
>> too little. Your reasoning is more concerned with having less timeouts.
>> So I think both approaches are valid, they're just different trade-off
>> points.
>>
>> I'm fine with submitting a follow up patch that gives up after the first
>> timeout, if you prefer that.
>>
>> Thanks,
>> - Tom
>>
> 
> Ok, that's fine with me.

Here is that follow-up patch.

OK for trunk?

Thanks,
- Tom

[-- Attachment #2: 0001-gdb-testsuite-Bail-out-after-1-timeout-in-test_complete_prefix_range_re.patch --]
[-- Type: text/x-patch, Size: 1445 bytes --]

[gdb/testsuite] Bail out after 1 timeout in test_complete_prefix_range_re

In test_complete_prefix_range_re we stop testing the range after 3 consecutive
timeouts.

Handle timeouts more rigorously by stopping testing after the first timeout.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-03-19  Tom de Vries  <tdevries@suse.de>

	* lib/completion-support.exp (test_complete_prefix_range_re): Stop
	testing after the first timeout.

---
 gdb/testsuite/lib/completion-support.exp | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/gdb/testsuite/lib/completion-support.exp b/gdb/testsuite/lib/completion-support.exp
index 18eac827f5..2bf3acd1f4 100644
--- a/gdb/testsuite/lib/completion-support.exp
+++ b/gdb/testsuite/lib/completion-support.exp
@@ -311,20 +311,11 @@ proc test_complete_prefix_range_re {input completion_re start {end -1}} {
 	set end [string length $input]
     }
 
-    set timeouts 0
-    set max_timeouts 3
     for {set i $start} {$i < $end} {incr i} {
 	set line [string range $input 0 $i]
 	set res [test_gdb_complete_unique_re "$line" $completion_re]
 	if { $res == -1 } {
-	    incr timeouts
-	} else {
-	    if { $timeouts > 0 } {
-		set timeouts 0
-	    }
-	}
-	if { $timeouts == $max_timeouts } {
-	    verbose -log "Consecutive timeouts in test_complete_prefix_range_re, giving up"
+	    verbose -log "Timeout in test_complete_prefix_range_re, giving up"
 	    break
 	}
     }

      reply	other threads:[~2020-03-19  6:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16 17:59 Tom de Vries
2020-03-17  8:06 ` Tom de Vries
2020-03-17 14:30 ` Simon Marchi
2020-03-17 14:53   ` Tom de Vries
2020-03-17 15:00     ` Simon Marchi
2020-03-19  6:58       ` Tom de Vries [this message]

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=8a23840e-60e5-2db0-93c0-55c5a3eab44a@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /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