From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10310 invoked by alias); 5 Feb 2010 07:22:36 -0000 Received: (qmail 10301 invoked by uid 22791); 5 Feb 2010 07:22:35 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Feb 2010 07:22:31 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id E36202BAC25 for ; Fri, 5 Feb 2010 02:22:29 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7O1ReTD-vpt9 for ; Fri, 5 Feb 2010 02:22:29 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 580C12BABF3 for ; Fri, 5 Feb 2010 02:22:29 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id A66DCF59A2; Fri, 5 Feb 2010 11:22:23 +0400 (RET) Date: Fri, 05 Feb 2010 07:22:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Re: [RFA/testsuite] Reset the timeout duration at the start of each testcase. Message-ID: <20100205072223.GB4335@adacore.com> References: <20100129153726.GC30542@caradoc.them.org> <1265263706-22569-1-git-send-email-brobecker@adacore.com> <20100204155956.GA14962@caradoc.them.org> <20100204174254.GC2715@adacore.com> <20100204181621.GB27544@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100204181621.GB27544@caradoc.them.org> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2010-02/txt/msg00158.txt.bz2 > > Just something that occured to me: What if I changed the implementation > > to just store $timeout at the time gdb.exp is evaluated? [...] > Here's another trick that will make it less confusing about > initialization order. How about we info exists to set > default_test_timeout from gdb_init, if we haven't yet? > > I know I've worked with board files that loaded gdb.exp themselves. In the end, I no longer think that this is such a good idea. I found several issues, mostly related to the order in which various .exp files are being loaded. The order is: 1. site.exp 2. various dejagnu .exp files. In my case: Found /usr/share/dejagnu/site.exp Loading /usr/share/dejagnu/utils.exp Loading /usr/share/dejagnu/framework.exp Loading /usr/share/dejagnu/debugger.exp Loading /usr/share/dejagnu/remote.exp Loading /usr/share/dejagnu/telnet.exp Loading /usr/share/dejagnu/rlogin.exp Loading /usr/share/dejagnu/kermit.exp Loading /usr/share/dejagnu/tip.exp Loading /usr/share/dejagnu/rsh.exp Loading /usr/share/dejagnu/ftp.exp Loading /usr/share/dejagnu/target.exp Loading /usr/share/dejagnu/targetdb.exp Loading /usr/share/dejagnu/libgloss.exp 3. [runtest.exp sets the timeout to 10] 4. target is unix => (a) dejagnu's unix.exp files (b) gdb/testsuite/config/unix.exp After that, it starts evaluating the testcases themselves. This implies: - Setting default_test_timeout from within gdb_init does not work, because this function is called after runtest.exp has reset the timeout back to 10 seconds (this is done after site.exp is loaded). - Also, even if we set the value of default_test_timeout earlier, during lib/gdb.exp loading (as opposed to during the first call to gdb_init), we still have another .exp file that resets the timeout from under our site.exp: gdb/testsuite/config/unix.exp. # Set a default timeout to be used for the tests under UNIX, rather than # accepting whatever default dejagnu gives us (apparently 10 seconds). # When running the tests over NFS, under somewhat heavy load, 10 seconds # does not seem to be enough. Try starting with 60. set timeout 60 verbose "Timeout is now $timeout seconds" 2 load_lib gdb.exp I managed to make it work, by removing the set timeout in config/unix.exp. But in the end, I think that's too fragile, and it also prevents us from defining our own general timeout - let's say we don't like the default timeout of 10 seconds and we want the default to be 30 seconds (I think 60s is way too much). With this second scheme, I couldn't see a way to do that. For this to be possible, we'd need to have control over a .exp file that gets sourced before site.exp. Of course, we could simply add a line in the generated site.exp to set the GDB timeout default, but that still leaves us with a fairly fragile scheme, IMO (and any breakage would probably go unnoticed). So I suggest we stay with the initial patch: A new global named default_test_timeout that the user can set in site.exp. -- Joel