This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/testsuite] Reset the timeout duration at the start of each testcase.
> > 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