From patchwork Mon Oct 14 16:14:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 34943 Received: (qmail 121550 invoked by alias); 14 Oct 2019 16:14:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 121470 invoked by uid 89); 14 Oct 2019 16:14:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Oct 2019 16:14:13 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 9C67E20862; Mon, 14 Oct 2019 12:14:11 -0400 (EDT) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [IPv6:2620:52:3:1:5054:ff:fe06:16ca]) by mx1.osci.io (Postfix) with ESMTP id BBA59208F0; Mon, 14 Oct 2019 12:14:05 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 920ED29ED0; Mon, 14 Oct 2019 12:14:05 -0400 (EDT) X-Gerrit-PatchSet: 7 Date: Mon, 14 Oct 2019 12:14:05 -0400 From: "Sourceware to Gerrit sync (Code Review)" To: Simon Marchi , gdb-patches@sourceware.org Cc: Tom de Vries , Andrew Burgess Auto-Submitted: auto-generated X-Gerrit-MessageType: merged Subject: Change in binutils-gdb[master]: gdb.mi/list-thread-groups-available.exp: read entries one by one inst... X-Gerrit-Change-Id: I51b689458503240f24e401f054e6583d9172ebdf X-Gerrit-Change-Number: 41 X-Gerrit-ChangeURL: X-Gerrit-Commit: 9223170f68f85787b9cd85e76d3bac3eaa69cafb In-Reply-To: References: Reply-To: noreply@gnutoolchain-gerrit.osci.io, simon.marchi@polymtl.ca, sergiodj@sergiodj.net, tdevries@suse.de, andrew.burgess@embecosm.com, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3 Message-Id: <20191014161405.920ED29ED0@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 + + * gdb.mi/list-thread-groups-available.exp: Read entries one by + one instead of increasing timeout. + 2019-10-13 Tom de Vries 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]