This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[obv] testsuite: Fix more racy FAILs
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 26 Dec 2011 12:28:22 +0100
- Subject: [obv] testsuite: Fix more racy FAILs
Hi,
there was:
[obv] testsuite: gdb.base/foll-exec.exp: Fix racy FAIL
http://sourceware.org/ml/gdb-patches/2011-12/msg00023.html
and I forgot the same case is present also in foll-vfork.exp causing more
races here:
(gdb) PASS: gdb.base/foll-vfork.exp: vfork and exec child follow, to main bp
kill
Kill the program being debugged? (y or n) y
file /home/jkratoch/hammock(gdb) FAIL: gdb.base/foll-vfork.exp: loading symbols (timeout)
ERROR: info breakpoints (timeout)
I have seen more send_gdb not expecting on their result, while they may be
safe I rather changed them to match their output to prevent more such possible
problems in advance.
No regressions on {x86_64,x86_64-m32,i686}-fedorarawhide-linux-gnu.
These issues are not reproducible with the code from PR testsuite/12649.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2011-12/msg00241.html
--- src/gdb/testsuite/ChangeLog 2011/12/24 23:54:20 1.3002
+++ src/gdb/testsuite/ChangeLog 2011/12/26 11:24:55 1.3003
@@ -1,3 +1,16 @@
+2011-12-26 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Fix double send_gdb leading to racy FAILs.
+ * gdb.base/break.exp (set silent break bp_location1): Replace
+ 3x send_gdb and gdb_expect by gdb_test.
+ * gdb.base/fileio.exp: Replace 2x send_gdb by gdb_exit and sleep.
+ * gdb.base/foll-vfork.exp (vfork_and_exec_child_follow_to_main_bp)
+ (vfork_and_exec_child_follow_through_step): Use gdb_test_no_output
+ instead of send_gdb. Twice.
+ * gdb.base/sepdebug.exp (set silent break bp_location1): Replace
+ 3x send_gdb and gdb_expect by gdb_test.
+ * gdb.mi/mi-nsmoribund.exp: Replace 3x send_gdb by mi_gdb_test.
+
2011-12-23 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.linespec/linespec.exp: Compile using {c++}.
--- src/gdb/testsuite/gdb.base/break.exp 2011/12/13 17:22:08 1.50
+++ src/gdb/testsuite/gdb.base/break.exp 2011/12/26 11:24:55 1.51
@@ -576,14 +576,7 @@
}
}
-send_gdb "commands $expect_out(1,string)\n"
-send_gdb "silent\n"
-send_gdb "end\n"
-gdb_expect {
- -re ".*$gdb_prompt $"\
- {pass "set silent break bp_location1"}
- timeout {fail "(timeout) set silent break bp_location1"}
-}
+gdb_test "commands $expect_out(1,string)\nsilent\nend" ">end" "set silent break bp_location1"
gdb_test "info break $expect_out(1,string)" \
"\[0-9\]*\[ \t\]*breakpoint.*:$bp_location1\r\n\[ \t\]*silent.*" \
--- src/gdb/testsuite/gdb.base/fileio.exp 2011/01/01 15:33:41 1.20
+++ src/gdb/testsuite/gdb.base/fileio.exp 2011/12/26 11:24:55 1.21
@@ -247,8 +247,9 @@
"Continuing\\..*time 2:.*OK$stop_msg" \
"Time(2) returns feasible values"
-send_gdb "quit\n"
-send_gdb "y\n"
+gdb_exit
+# Wait till GDB really exits.
+sleep 1
remote_exec build {sh -xc test\ -r\ dir2.fileio.test\ &&\ chmod\ -f\ +w\ dir2.fileio.test}
remote_exec build {sh -xc rm\ -rf\ *.fileio.test}
--- src/gdb/testsuite/gdb.base/foll-vfork.exp 2011/01/11 19:16:23 1.16
+++ src/gdb/testsuite/gdb.base/foll-vfork.exp 2011/12/26 11:24:55 1.17
@@ -166,7 +166,7 @@
send_gdb "kill\n"
gdb_expect {
-re ".*Kill the program being debugged.*y or n. $" {
- send_gdb "y\n"
+ gdb_test_no_output "y" ""
send_gdb "file $binfile\n"
gdb_expect {
-re ".*Load new symbol table from.*y or n. $" {
@@ -224,7 +224,7 @@
send_gdb "kill\n"
gdb_expect {
-re ".*Kill the program being debugged.*y or n. $" {
- send_gdb "y\n"
+ gdb_test_no_output "y" ""
send_gdb "file $binfile\n"
gdb_expect {
-re ".*Load new symbol table from.*y or n. $" {
--- src/gdb/testsuite/gdb.base/sepdebug.exp 2011/12/13 17:22:08 1.31
+++ src/gdb/testsuite/gdb.base/sepdebug.exp 2011/12/26 11:24:55 1.32
@@ -370,14 +370,7 @@
}
}
-send_gdb "commands $expect_out(1,string)\n"
-send_gdb "silent\n"
-send_gdb "end\n"
-gdb_expect {
- -re ".*$gdb_prompt $"\
- {pass "set silent break bp_location1"}
- timeout {fail "(timeout) set silent break bp_location1"}
-}
+gdb_test "commands $expect_out(1,string)\nsilent\nend" ">end" "set silent break bp_location1"
gdb_test "info break $expect_out(1,string)" \
"\[0-9\]*\[ \t\]*breakpoint.*:$bp_location1\r\n\[ \t\]*silent.*" \
--- src/gdb/testsuite/gdb.mi/mi-nsmoribund.exp 2011/08/09 17:45:19 1.14
+++ src/gdb/testsuite/gdb.mi/mi-nsmoribund.exp 2011/12/26 11:24:55 1.15
@@ -118,9 +118,9 @@
# we are interested in, so we can't use mi_gdb_test or
# gdb_test_multiple (or an MI equivalent)
-send_gdb "102-break-delete\n"
-send_gdb "print done = 1\n"
-send_gdb "103-exec-continue --all\n"
+mi_gdb_test "102-break-delete" "102\\^done.*"
+mi_gdb_test "print done = 1" { = 1"}
+mi_gdb_test "103-exec-continue --all" "\[^\n\]*\r\n$running_re"
gdb_expect {
-re "\\*stopped,reason=\"exited-normally\"" {