Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Joel Brobecker <brobecker@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [patch] print-threads.exp: Extend timeout for slower tests.
Date: Tue, 08 Nov 2011 08:11:00 -0000	[thread overview]
Message-ID: <CADPb22SWZmfqR5g=51-4e5QS61ciwfqNZGFhugMfQ9rgw+iRng@mail.gmail.com> (raw)
In-Reply-To: <20111108075608.GA22184@host1.jankratochvil.net>

On Mon, Nov 7, 2011 at 11:56 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Mon, 07 Nov 2011 17:22:02 +0100, Joel Brobecker wrote:
>> > >> +# Record the old timeout, we need to extend it for slower tests.
>> > >> +set oldtimeout $timeout
>> > >
>> > > You can use global $gdb_test_timeout nowadays.
>> >
>> > Thanks, I didn't know about gdb_test_timeout.
>> > Still, I like the patch as is, one less global the code has to care about.
>>
>> Same here.
>
> I did not agree with Doug.  I think there was just some misunderstanding.
>
> I was proposing the attached patch.
>
> The very last line is sure redundant but I think it should be there for the
> possibility of future test additions.
>
> Found in Doug's original patch:
>        set $timeout $oldtimeout
> should have been:
>        set timeout $oldtimeout

That's just a typo (obviously).

>
> Thanks,
> Jan
>
>
> gdb/testsuite/
> 2011-11-08  Doug Evans  <dje@google.com>
>            Jan Kratochvil  <jan.kratochvil@redhat.com>
>
>        * gdb.threads/print-threads.exp: Extend timeout for slower tests.
>
> --- a/gdb/testsuite/gdb.threads/print-threads.exp
> +++ b/gdb/testsuite/gdb.threads/print-threads.exp
> @@ -106,12 +106,18 @@ test_all_threads "fast" 0
>  runto_main
>  gdb_test "break thread_function" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*print-threads.c, line \[0-9\]*\\." "break thread_function (2)"
>  gdb_test_no_output "set var slow = 1"
> +# Extend the timeout for slower tests.
> +set timeout [expr $gdb_test_timeout + 120]
>  test_all_threads "slow" 0
> +set timeout $gdb_test_timeout
>
>  runto_main
>  gdb_test "break thread_function" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*print-threads.c, line \[0-9\]*\\." "break thread_function (3)"
>  gdb_test_no_output "set var slow = 1" "set var slow = 1 (2)"
>  gdb_breakpoint "kill"
> +# Extend the timeout for slower tests.
> +set timeout [expr $gdb_test_timeout + 120]
>  test_all_threads "slow with kill breakpoint" 1
> +set timeout $gdb_test_timeout
>
>  return 0
>

I disagree.
There are no existing uses of gdb_test_timeout outside of lib/gdb.exp,
and regardless, I prefer my patch.  "timeout" is a standard global variable
.exp writers know about.  Adding gdb_test_timeout is one more global,
one more bit of context .exp writers are expected to know about.  I
think it's fine as a mechanism to ensure a stable and consistent value
at the start of the test, but that his hidden by lib/gdb.exp routines.
 Once I'm in a testsuite .exp file, I'd rather not have to involve it
in my hacking.


  reply	other threads:[~2011-11-08  8:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-02 22:12 Doug Evans
2011-11-02 23:22 ` Jan Kratochvil
2011-11-03 15:47   ` Doug Evans
2011-11-07 16:22     ` Joel Brobecker
2011-11-08  7:56       ` Jan Kratochvil
2011-11-08  8:11         ` Doug Evans [this message]
2011-11-08  9:01           ` Jan Kratochvil

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='CADPb22SWZmfqR5g=51-4e5QS61ciwfqNZGFhugMfQ9rgw+iRng@mail.gmail.com' \
    --to=dje@google.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /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