Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix racy test in gdb.threads/thread-specific-bp.exp
@ 2017-04-03 21:06 Yao Qi
  2017-04-04  1:49 ` Simon Marchi
  0 siblings, 1 reply; 4+ messages in thread
From: Yao Qi @ 2017-04-03 21:06 UTC (permalink / raw)
  To: gdb-patches

I see the following test fail from time to time, due to the racy test
in gdb.threads/thread-specific-bp.exp.

continue -a^M
Continuing.^M
^M
Thread 1 "thread-specific" hit Breakpoint 4, end () at binutils-gdb/gdb/testsuite/gdb.threads/thread-specific-bp.c:29^M
29      }^M
(gdb) [Thread 0x40322460 (LWP 12950) exited]^M
Thread-specific breakpoint 3 deleted - thread 2 no longer in the thread list.^M
FAIL: gdb.threads/thread-specific-bp.exp: non-stop: continue to end (timeout)

This patch changes gdb_test to gdb_test_multiple to match prompt only
instead of both prompt and anchor.

gdb/testsuite:

2017-04-03  Yao Qi  <yao.qi@linaro.org>

	* gdb.threads/thread-specific-bp.exp (check_thread_specific_breakpoint):
	Use gdb_test_multiple, and don't match anchor.
---
 gdb/testsuite/gdb.threads/thread-specific-bp.exp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.threads/thread-specific-bp.exp b/gdb/testsuite/gdb.threads/thread-specific-bp.exp
index bdf12f8..a652e9c 100644
--- a/gdb/testsuite/gdb.threads/thread-specific-bp.exp
+++ b/gdb/testsuite/gdb.threads/thread-specific-bp.exp
@@ -87,9 +87,12 @@ proc check_thread_specific_breakpoint {mode} {
 	} else {
 	    set cmd "continue"
 	}
-	gdb_test "$cmd" \
-	    "Breakpoint .* end .* at .*" \
-	    "continue to end"
+	set test "continue to end"
+	gdb_test_multiple "$cmd" $test {
+	    -re "Breakpoint .* end .* at .*(\[^\r\n\]*)\r\n$gdb_prompt " {
+		pass $test
+	    }
+	}
 
 	set test "thread-specific breakpoint was deleted"
 	gdb_test_multiple "info breakpoint" $test {
-- 
1.9.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-04 13:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-03 21:06 [PATCH] Fix racy test in gdb.threads/thread-specific-bp.exp Yao Qi
2017-04-04  1:49 ` Simon Marchi
2017-04-04  8:08   ` Yao Qi
2017-04-04 13:37     ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox