Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Sourceware to Gerrit sync (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Cc: Tom de Vries <tdevries@suse.de>,
	Andrew Burgess <andrew.burgess@embecosm.com>
Subject: Change in binutils-gdb[master]: gdb.mi/list-thread-groups-available.exp: read entries one by one inst...
Date: Mon, 14 Oct 2019 16:14:00 -0000	[thread overview]
Message-ID: <20191014161405.920ED29ED0@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1571064731000.I51b689458503240f24e401f054e6583d9172ebdf@gnutoolchain-gerrit.osci.io>

Sourceware to Gerrit sync has submitted this change. ( https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/41 )

Change subject: gdb.mi/list-thread-groups-available.exp: read entries one by one instead of increasing timeout
......................................................................

gdb.mi/list-thread-groups-available.exp: read entries one by one instead of increasing timeout

Commit 580f1034 ("Increase timeout in
gdb.mi/list-thread-groups-available.exp") changed
gdb.mi/list-thread-groups-available.exp to significantly increase the
timeout, which was necessary for when running with make check-read1.

Pedro suggested a better alternative, which is to use gdb_test_multiple
and consume one entry at a time.  This patch does that.

gdb/testsuite/ChangeLog:

	* gdb.mi/list-thread-groups-available.exp: Read entries one by
	one instead of increasing timeout.

Change-Id: I51b689458503240f24e401f054e6583d9172ebdf
---
M gdb/testsuite/ChangeLog
M gdb/testsuite/gdb.mi/list-thread-groups-available.exp
2 files changed, 23 insertions(+), 9 deletions(-)



diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index ba72489..ce6e0f2 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-10-14  Simon Marchi <simon.marchi@polymtl.ca>
+
+	* gdb.mi/list-thread-groups-available.exp: Read entries one by
+	one instead of increasing timeout.
+
 2019-10-13  Tom de Vries  <tdevries@suse.de>
 
 	PR record/25038
diff --git a/gdb/testsuite/gdb.mi/list-thread-groups-available.exp b/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
index ab5c716..3a7517f 100644
--- a/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
+++ b/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
@@ -54,15 +54,24 @@
 # List all available processes.
 set process_entry_re "{${id_re},${type_re}(,$description_re)?(,$user_re)?(,$cores_re)?}"
 
-# Increase the timeout: when running with `make check-read1`, this can take
-# a bit of time, as there is a lot of output generated, hence a lot of read
-# syscalls.
-with_read1_timeout_factor 10 {
-    mi_gdb_test \
-	"-list-thread-groups --available" \
-	"\\^done,groups=\\\[${process_entry_re}(,$process_entry_re)*\\\]" \
-	"list available thread groups"
-}
+# The list can be long, so read entries one by one to avoid hitting the
+# timeout (especially when running with check-read1).
+gdb_test_multiple "-list-thread-groups --available" "list available thread groups" {
+    -re "\\^done,groups=\\\[" {
+	# The beginning of the response.
+	exp_continue
+    }
+
+    -re "${process_entry_re}," {
+	# All entries except the last one.
+	exp_continue
+    }
+
+    -re "${process_entry_re}\\\]\r\n${mi_gdb_prompt}" {
+	# The last entry.
+	pass $gdb_test_name
+    }
+} $mi_gdb_prompt
 
 # List specific processes, make sure there are two entries.
 set spawn_id_1 [remote_spawn target $binfile]

-- 
To view, visit https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/41
To unsubscribe, or for help writing mail filters, visit https://gnutoolchain-gerrit.osci.io/r/settings

Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I51b689458503240f24e401f054e6583d9172ebdf
Gerrit-Change-Number: 41
Gerrit-PatchSet: 7
Gerrit-Owner: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Reviewer: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-Reviewer: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Reviewer: Tom de Vries <tdevries@suse.de>
Gerrit-MessageType: merged


      parent reply	other threads:[~2019-10-14 16:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <gerrit.1571064731000.I51b689458503240f24e401f054e6583d9172ebdf@gnutoolchain-gerrit.osci.io>
2019-10-14 15:50 ` Simon Marchi (Code Review)
2019-10-14 15:51 ` Simon Marchi (Code Review)
2019-10-14 16:01 ` Tom de Vries (Code Review)
2019-10-14 18:47   ` Gerrit request (Was: Change in binutils-gdb[master]: gdb.mi/list-thread-groups-available.exp: read entries one by one inst...) Tom Tromey
2019-10-15  0:44     ` Simon Marchi
2019-10-15  1:16       ` Simon Marchi
2019-10-15 17:09         ` Gerrit request Tom Tromey
2019-10-15 17:12           ` Sergio Durigan Junior
2019-10-15 19:45             ` Simon Marchi
2019-10-14 16:06 ` Change in binutils-gdb[master]: gdb.mi/list-thread-groups-available.exp: read entries one by one inst Simon Marchi (Code Review)
2019-10-14 16:07 ` Simon Marchi (Code Review)
2019-10-14 16:08 ` Tom de Vries (Code Review)
2019-10-14 16:14 ` Sourceware to Gerrit sync (Code Review)
2019-10-14 16:14 ` Sourceware to Gerrit sync (Code Review) [this message]

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=20191014161405.920ED29ED0@gnutoolchain-gerrit.osci.io \
    --to=gerrit@gnutoolchain-gerrit.osci.io \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=noreply@gnutoolchain-gerrit.osci.io \
    --cc=sergiodj@sergiodj.net \
    --cc=simon.marchi@polymtl.ca \
    --cc=tdevries@suse.de \
    /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