From: Daniel Jacobowitz <dan@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: RFC: Fix testsuite timeout clobbers
Date: Thu, 28 Jan 2010 21:53:00 -0000 [thread overview]
Message-ID: <20100128215305.GA2813@caradoc.them.org> (raw)
There are many GDB tests that have a "set timeout" in them.
Unfortunately, because we have a single global variable for the
timeout, this means that tests have different timeouts if they are run
independently or in order.
This patch cleans out many (probably not all, but all I could find)
cases of tests which modify the timeout and fail to reset it.
The timeouts are old and somewhat made up. Still, I'm sure that
this will cause something to time out; if it does, we'll add timeouts
on a case-by-case basis.
Any comments on this? Otherwise, I'll check it in next week.
--
Daniel Jacobowitz
CodeSourcery
2010-01-28 Daniel Jacobowitz <dan@codesourcery.com>
gdb/testsuite/
* gdb.base/call-strs.exp, gdb.base/default.exp,
gdb.base/ending-run.exp, gdb.base/finish.exp, gdb.base/funcargs.exp,
gdb.base/huge.exp, gdb.base/nodebug.exp, gdb.base/ptype.exp,
gdb.base/restore.exp, gdb.base/return.exp, gdb.base/setvar.exp,
gdb.base/watchpoints.exp, gdb.threads/gcore-thread.exp,
gdb.base/watchpoint-solib.exp: Save and restore timeout.
* gdb.base/ending-run.exp: Correct restore of timeout.
* gdb.base/page.exp: Remove unnecessary timeout setting.
---
gdb/testsuite/gdb.base/call-strs.exp | 9 ++++++---
gdb/testsuite/gdb.base/default.exp | 3 +++
gdb/testsuite/gdb.base/ending-run.exp | 4 ++--
gdb/testsuite/gdb.base/finish.exp | 2 ++
gdb/testsuite/gdb.base/freebpcmd.exp | 3 +++
gdb/testsuite/gdb.base/funcargs.exp | 3 +++
gdb/testsuite/gdb.base/huge.exp | 2 ++
gdb/testsuite/gdb.base/nodebug.exp | 4 +++-
gdb/testsuite/gdb.base/page.exp | 5 -----
gdb/testsuite/gdb.base/ptype.exp | 5 ++++-
gdb/testsuite/gdb.base/restore.exp | 2 ++
gdb/testsuite/gdb.base/return.exp | 2 ++
gdb/testsuite/gdb.base/setvar.exp | 5 ++++-
gdb/testsuite/gdb.base/watchpoint-solib.exp | 8 ++++----
gdb/testsuite/gdb.base/watchpoints.exp | 3 ++-
gdb/testsuite/gdb.threads/gcore-thread.exp | 2 ++
16 files changed, 44 insertions(+), 18 deletions(-)
Index: gdb-mainline/gdb/testsuite/gdb.base/call-strs.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/call-strs.exp 2010-01-01 00:27:53.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.base/call-strs.exp 2010-01-12 14:30:07.000000000 -0800
@@ -95,13 +95,14 @@ send_gdb "set print sevenbit-strings\n"
send_gdb "set print address off\n" ; gdb_expect -re "$gdb_prompt $"
send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $"
-set timeout 120
-
if ![runto_main] then {
perror "couldn't run to breakpoint"
continue
}
+set prev_timeout $timeout
+set timeout 120
+
#step
send_gdb "step\n"
gdb_expect {
@@ -263,4 +264,6 @@ if ![gdb_skip_stdio_test "call str_func(
}
gdb_exit
-return 0
+
+set timeout $prev_timeout
+
Index: gdb-mainline/gdb/testsuite/gdb.base/default.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/default.exp 2010-01-01 00:27:53.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.base/default.exp 2010-01-12 14:32:03.000000000 -0800
@@ -20,6 +20,7 @@
gdb_exit
gdb_start
+set prev_timeout $timeout
set timeout 60
#
@@ -801,3 +802,5 @@ gdb_test "where" "No stack." "where"
gdb_test "x" "Argument required .starting display address.*" "x"
gdb_exit
+
+set timeout $prev_timeout
Index: gdb-mainline/gdb/testsuite/gdb.base/ending-run.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/ending-run.exp 2010-01-01 00:27:54.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.base/ending-run.exp 2010-01-12 14:33:19.000000000 -0800
@@ -261,8 +261,6 @@ if {! [target_info exists use_gdb_stub]
unsupported "continue after exit"
}
- set timeout $old_timeout
-
if {$program_exited_normally} {
gdb_test "n" ".*The program is not being run.*" "don't step after run"
} elseif {$program_not_exited} {
@@ -285,6 +283,8 @@ if {! [target_info exists use_gdb_stub]
}
}
+set timeout $old_timeout
+
#remote_exec build "rm -f ${binfile}"
return 0
Index: gdb-mainline/gdb/testsuite/gdb.base/finish.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/finish.exp 2010-01-01 00:27:54.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.base/finish.exp 2010-01-12 14:33:44.000000000 -0800
@@ -124,5 +124,7 @@ proc finish_tests { } {
finish_abbreviation "fin"
}
+set prev_timeout $timeout
set timeout 30
finish_tests
+set timeout $prev_timeout
Index: gdb-mainline/gdb/testsuite/gdb.base/freebpcmd.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/freebpcmd.exp 2010-01-01 00:27:54.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.base/freebpcmd.exp 2010-01-12 14:36:05.000000000 -0800
@@ -108,6 +108,7 @@ if {$i >= [llength $lines]} {
gdb_run_cmd
+set prev_timeout $timeout
set timeout 120
gdb_test_multiple "" "run program with breakpoint commands" {
@@ -121,3 +122,5 @@ gdb_test_multiple "" "run program with b
kfail "gdb/1489" "run program with breakpoint commands (GDB died)"
}
}
+
+set timeout $prev_timeout
Index: gdb-mainline/gdb/testsuite/gdb.base/funcargs.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/funcargs.exp 2010-01-01 00:27:54.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.base/funcargs.exp 2010-01-12 15:02:00.000000000 -0800
@@ -1149,6 +1149,7 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
+set prev_timeout $timeout
if [istarget "mips*tx39-*"] {
set timeout 300
} else {
@@ -1223,3 +1224,5 @@ funcargs_reload
localvars_in_indirect_call
funcargs_reload
test_stepping_over_trampolines
+
+set timeout $prev_timeout
Index: gdb-mainline/gdb/testsuite/gdb.base/huge.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/huge.exp 2010-01-01 00:27:54.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.base/huge.exp 2010-01-12 14:36:47.000000000 -0800
@@ -50,6 +50,7 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
+set prev_timeout $timeout
set timeout 30
if { ! [ runto_main ] } then {
@@ -59,3 +60,4 @@ if { ! [ runto_main ] } then {
gdb_test "print a" ".1 = .0 .repeats \[0123456789\]+ times.." "print a very large data object"
+set timeout $prev_timeout
Index: gdb-mainline/gdb/testsuite/gdb.base/nodebug.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/nodebug.exp 2010-01-01 00:27:54.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.base/nodebug.exp 2010-01-12 14:46:22.000000000 -0800
@@ -202,8 +202,10 @@ if [runto inner] then {
} else {
# We need to up this because this can be really slow on some boards.
# (malloc() is called as part of the test).
- set timeout 60;
+ set prev_timeout $timeout
+ set timeout 60
gdb_test {p/c array_index("abcdef",2)} " = 99 'c'"
+ set timeout $prev_timeout
}
}
Index: gdb-mainline/gdb/testsuite/gdb.base/page.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/page.exp 2010-01-01 00:27:54.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.base/page.exp 2010-01-12 14:47:22.000000000 -0800
@@ -20,11 +20,6 @@ if $tracelevel {
strace $tracelevel
}
-global message
-global timeout
-
-set timeout 200
-
gdb_exit
gdb_start
Index: gdb-mainline/gdb/testsuite/gdb.base/ptype.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/ptype.exp 2010-01-01 00:27:54.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.base/ptype.exp 2010-01-12 14:49:06.000000000 -0800
@@ -626,7 +626,8 @@ if [runto_main] then {
# We need to up this because this can be really slow on some boards.
# (malloc() is called as part of the test).
- set timeout 60;
+ set prev_timeout $timeout
+ set timeout 60
gdb_test "ptype \"abc\"" "type = char \\\[4\\\]"
gdb_test "ptype {'a','b','c'}" "type = char \\\[3\\\]"
@@ -637,6 +638,8 @@ if [runto_main] then {
gdb_test "ptype {4,5,6}\[2\]" "type = int"
gdb_test "ptype *&{4,5,6}\[1\]" "Attempt to take address of value not located in memory."
+ set timeout $prev_timeout
+
# Test ptype of user register
gdb_test "ptype \$pc" "void \\(\\*\\)\\(\\)" "ptype \$pc"
}
Index: gdb-mainline/gdb/testsuite/gdb.base/restore.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/restore.exp 2010-01-01 00:27:54.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.base/restore.exp 2010-01-12 14:50:00.000000000 -0800
@@ -116,5 +116,7 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
+set prev_timeout $timeout
set timeout 30
restore_tests
+set timeout $prev_timeout
Index: gdb-mainline/gdb/testsuite/gdb.base/return.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/return.exp 2010-01-01 00:27:54.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.base/return.exp 2010-01-12 15:02:13.000000000 -0800
@@ -91,5 +91,7 @@ proc return_tests { } {
gdb_test "p tmp3" ".* = 5.*" "correct value returned double test (known problem with sparc solaris)"
}
+set prev_timeout $timeout
set timeout 30
return_tests
+set timeout $prev_timeout
Index: gdb-mainline/gdb/testsuite/gdb.base/setvar.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/setvar.exp 2010-01-01 00:27:54.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.base/setvar.exp 2010-01-12 14:51:30.000000000 -0800
@@ -374,7 +374,8 @@ v_long_member = 3,.*v_float_member = 4,.
# We need to up this because this can be really slow on some boards.
# (malloc() is called as part of the test).
-set timeout 60;
+set prev_timeout $timeout
+set timeout 60
# Change the values
test_set "set variable v_struct1 = {32, 33, 34, 35, 36, 37}" \
@@ -392,6 +393,8 @@ test_set "set variable v_struct1 = {'h',
v_long_member = 3,.*v_float_member = 4,.*v_double_member = 5.*\\}" \
"set print structure #3"
+set timeout $prev_timeout
+
# Test printing of enumeration bitfields.
# GNU C supports them, some other compilers don't.
Index: gdb-mainline/gdb/testsuite/gdb.base/watchpoints.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/watchpoints.exp 2010-01-01 00:27:55.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.base/watchpoints.exp 2010-01-12 14:52:52.000000000 -0800
@@ -53,6 +53,7 @@ gdb_load $binfile
gdb_test "watch ival1" "" ""
gdb_test "watch ival3" "" ""
+ set prev_timeout $timeout
set timeout 600
gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival1.*Old value = -1.*New value = 0.*ival1 = count; ival2 = count;.*" "watchpoint hit, first time"
@@ -102,4 +103,4 @@ gdb_load $binfile
# Check that the hit count is reported correctly
gdb_test "info break" ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+ival3\r\n\[ \t]+breakpoint already hit 5 times.*" "Watchpoint hit count is 5"
-
+set timeout $prev_timeout
Index: gdb-mainline/gdb/testsuite/gdb.threads/gcore-thread.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.threads/gcore-thread.exp 2010-01-01 00:27:57.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.threads/gcore-thread.exp 2010-01-12 14:53:36.000000000 -0800
@@ -55,6 +55,7 @@ set horiz "\[^\n\r\]*"
# regexp for newline
set nl "\[\r\n\]+"
+set prev_timeout $timeout
set timeout 30
send_gdb "help gcore\n"
@@ -174,3 +175,4 @@ gdb_test "info threads" ".* thread2 .*"
gdb_test "info threads" ".*${nl}\\* ${horiz} thread2 .*" \
"thread2 is current thread in corefile"
+set timeout $prev_timeout
Index: gdb-mainline/gdb/testsuite/gdb.base/watchpoint-solib.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/watchpoint-solib.exp 2010-01-13 06:25:37.000000000 -0800
+++ gdb-mainline/gdb/testsuite/gdb.base/watchpoint-solib.exp 2010-01-13 06:25:50.000000000 -0800
@@ -83,6 +83,9 @@ gdb_test_multiple "break foo" "set pendi
}
}
+set prev_timeout $timeout
+set timeout 120
+
gdb_test "continue" ".*Breakpoint 2.*foo.*" "continue to foo"
gdb_test "watch g" "atchpoint 3: g" "set watchpoint on g"
gdb_test "continue" ".*New value = 1.*" "continue to watchpoint hit"
@@ -90,7 +93,4 @@ rerun_to_main
gdb_test "continue" ".*Breakpoint 2.*foo.*" "continue to foo again"
gdb_test "continue" ".*New value = 1.*" "continue to watchpoint hit again"
-
-
-
-
+set timeout $prev_timeout
next reply other threads:[~2010-01-28 21:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-28 21:53 Daniel Jacobowitz [this message]
2010-01-29 4:00 ` Joel Brobecker
2010-01-29 15:37 ` Daniel Jacobowitz
2010-02-04 6:08 ` [RFA/testsuite] Reset the timeout duration at the start of each testcase Joel Brobecker
2010-02-04 15:54 ` Tom Tromey
2010-02-04 16:00 ` Daniel Jacobowitz
2010-02-04 17:43 ` Joel Brobecker
2010-02-04 18:16 ` Daniel Jacobowitz
2010-02-05 7:22 ` Joel Brobecker
2010-02-05 17:33 ` Daniel Jacobowitz
2010-02-08 11:36 ` Joel Brobecker
2010-02-04 6:13 ` RFC: Fix testsuite timeout clobbers Joel Brobecker
2010-01-29 16:49 ` Tom Tromey
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=20100128215305.GA2813@caradoc.them.org \
--to=dan@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/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