From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27976 invoked by alias); 8 Nov 2011 08:11:49 -0000 Received: (qmail 27958 invoked by uid 22791); 8 Nov 2011 08:11:45 -0000 X-SWARE-Spam-Status: No, hits=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-qw0-f41.google.com (HELO mail-qw0-f41.google.com) (209.85.216.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Nov 2011 08:11:32 +0000 Received: by qadc11 with SMTP id c11so144846qad.0 for ; Tue, 08 Nov 2011 00:11:31 -0800 (PST) Received: by 10.224.217.131 with SMTP id hm3mr14217201qab.81.1320739891408; Tue, 08 Nov 2011 00:11:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.217.131 with SMTP id hm3mr14217189qab.81.1320739891280; Tue, 08 Nov 2011 00:11:31 -0800 (PST) Received: by 10.224.6.76 with HTTP; Tue, 8 Nov 2011 00:11:31 -0800 (PST) In-Reply-To: <20111108075608.GA22184@host1.jankratochvil.net> References: <20111102221154.8A3C12461B1@ruffy.mtv.corp.google.com> <20111102232147.GA7605@host1.jankratochvil.net> <20111107162202.GG14508@adacore.com> <20111108075608.GA22184@host1.jankratochvil.net> Date: Tue, 08 Nov 2011 08:11:00 -0000 Message-ID: Subject: Re: [patch] print-threads.exp: Extend timeout for slower tests. From: Doug Evans To: Jan Kratochvil Cc: Joel Brobecker , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-11/txt/msg00179.txt.bz2 On Mon, Nov 7, 2011 at 11:56 PM, Jan Kratochvil 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 ab= out. >> >> Same here. > > I did not agree with Doug. =A0I think there was just some misunderstandin= g. > > I was proposing the attached patch. > > The very last line is sure redundant but I think it should be there for t= he > possibility of future test additions. > > Found in Doug's original patch: > =A0 =A0 =A0 =A0set $timeout $oldtimeout > should have been: > =A0 =A0 =A0 =A0set timeout $oldtimeout That's just a typo (obviously). > > Thanks, > Jan > > > gdb/testsuite/ > 2011-11-08 =A0Doug Evans =A0 > =A0 =A0 =A0 =A0 =A0 =A0Jan Kratochvil =A0 > > =A0 =A0 =A0 =A0* 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 > =A0runto_main > =A0gdb_test "break thread_function" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+= : file .*print-threads.c, line \[0-9\]*\\." "break thread_function (2)" > =A0gdb_test_no_output "set var slow =3D 1" > +# Extend the timeout for slower tests. > +set timeout [expr $gdb_test_timeout + 120] > =A0test_all_threads "slow" 0 > +set timeout $gdb_test_timeout > > =A0runto_main > =A0gdb_test "break thread_function" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+= : file .*print-threads.c, line \[0-9\]*\\." "break thread_function (3)" > =A0gdb_test_no_output "set var slow =3D 1" "set var slow =3D 1 (2)" > =A0gdb_breakpoint "kill" > +# Extend the timeout for slower tests. > +set timeout [expr $gdb_test_timeout + 120] > =A0test_all_threads "slow with kill breakpoint" 1 > +set timeout $gdb_test_timeout > > =A0return 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.