From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/5] Fix test_gdb_complete_tab_multiple race
Date: Thu, 27 Jun 2019 19:14:00 -0000 [thread overview]
Message-ID: <20190627191427.20742-2-palves@redhat.com> (raw)
In-Reply-To: <20190627191427.20742-1-palves@redhat.com>
Running 'make check-read1 TESTS="gdb.base/options.exp"' revealed a
race in test_gdb_complete_tab_multiple. There's a gdb_test_multiple
call that expects a prompt in the middle of the regexp. That's racy
because gdb_test_multiple includes a built-in FAIL pattern for the
prompt, which may match if gdb is slow enough to produce the rest of
the output after the prompt.
Fix this in the usual way of splitting the matching in two.
gdb/testsuite/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>
* lib/completion-support.exp (test_gdb_complete_tab_multiple):
Split one gdb_test_multiple call in two to avoid a race.
---
gdb/testsuite/lib/completion-support.exp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/lib/completion-support.exp b/gdb/testsuite/lib/completion-support.exp
index 97fed18b055..3199e85fd4d 100644
--- a/gdb/testsuite/lib/completion-support.exp
+++ b/gdb/testsuite/lib/completion-support.exp
@@ -151,8 +151,12 @@ proc test_gdb_complete_tab_multiple { input_line add_completed_line \
set maybe_bell ""
}
gdb_test_multiple "" "$test (second tab)" {
- -re "^${maybe_bell}\r\n$expected_re\r\n$gdb_prompt $input_line_re$add_completed_line_re$" {
- pass "$test"
+ -re "^${maybe_bell}\r\n$expected_re\r\n$gdb_prompt " {
+ gdb_test_multiple "" "$test (second tab)" {
+ -re "^$input_line_re$add_completed_line_re$" {
+ pass "$test"
+ }
+ }
}
}
}
--
2.14.5
next prev parent reply other threads:[~2019-06-27 19:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-27 19:14 [PATCH 0/5] pipe command completer, and string options Pedro Alves
2019-06-27 19:14 ` [PATCH 2/5] Make gdb::option::complete_options save processed arguments too Pedro Alves
2019-06-27 19:14 ` [PATCH 5/5] pipe command completer Pedro Alves
2019-06-28 15:16 ` Tom Tromey
2019-07-03 16:28 ` Pedro Alves
2019-06-27 19:14 ` Pedro Alves [this message]
2019-06-27 19:14 ` [PATCH 4/5] Fix latent bug in test_gdb_complete_cmd_multiple Pedro Alves
2019-06-28 14:53 ` Tom Tromey
2019-06-28 14:56 ` Pedro Alves
2019-06-28 15:46 ` Tom Tromey
2019-06-27 19:14 ` [PATCH 3/5] Teach gdb::option about string options Pedro Alves
2019-06-28 15:11 ` Tom Tromey
2019-06-28 15:16 ` [PATCH 0/5] pipe command completer, and " 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=20190627191427.20742-2-palves@redhat.com \
--to=palves@redhat.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