Message ID | 1535991124-28668-1-git-send-email-gbenson@redhat.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 28511 invoked by alias); 3 Sep 2018 16:12:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 28385 invoked by uid 89); 3 Sep 2018 16:12:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*Ad:U*tom, gary, Gary, hurt X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Sep 2018 16:12:12 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9FE3C40241C4; Mon, 3 Sep 2018 16:12:10 +0000 (UTC) Received: from blade.nx (ovpn-117-121.ams2.redhat.com [10.36.117.121]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7CFCE2157F45; Mon, 3 Sep 2018 16:12:08 +0000 (UTC) Received: from blade.com (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id AAFDD8143DB9; Mon, 3 Sep 2018 17:12:07 +0100 (BST) From: Gary Benson <gbenson@redhat.com> To: gdb-patches@sourceware.org Cc: Pedro Alves <palves@redhat.com>, Sergio Durigan Junior <sergiodj@redhat.com>, Tom Tromey <tom@tromey.com> Subject: [PATCH] Fix batch exit status test failure on Fedora 28 Date: Mon, 3 Sep 2018 17:12:04 +0100 Message-Id: <1535991124-28668-1-git-send-email-gbenson@redhat.com> In-Reply-To: <813f3a12-ff85-c48a-aede-7aa89b1ae889@redhat.com> X-IsSubscribed: yes |
Commit Message
Gary Benson
Sept. 3, 2018, 4:12 p.m. UTC
Pedro Alves <palves@redhat.com> wrote: > Yeah, if we compare with gdb.base/quit.exp, that is missing > as well as the "remote_close host" call. For the latter, when I last > touched quit.exp, I remember fretting a bit about whether the remote_close > was really necessary, but in the end decided to keep it, I don't recall > exactly if I kept it because I found it's necessary (probably for > remote hosts), or because it doesn't hurt. > > Now that I look at gdb.base/quit.exp again, I see that > gdb.base/batch-exit-status.exp can hang forever in the same way that > 15763a09d4ae fixed, isn't it? Gary, any reason you didn't do the > "eof" thing here too? I didn't realize what it did; I thought it was something specific to that test. And I thought the gdb_exit at the start of the test would clear $gdb_spawn_id but apparently not! :) So I made a fix, basically copied and pasted from the commit you referenced: This commit changes the batch exit status test to detect GDB's exit using gdb_test_multiple expecting 'eof', instead of using 'wait'. This fixes failures reported by buildbot on Fedora 28, and also means the testcase won't hang forever on failure as fixed in gdb.base/quit.exp by commit 15763a09d4aea85fc3153d6746c040dd48565637. Is this ok to commit? Thanks, Gary -- gdb/testsuite/ChangeLog: * gdb.base/batch-exit-status.exp: Use gdb_test_multiple and expect 'eof' before 'wait -i'. Use remote_close and clear_gdb_spawn_id. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.base/batch-exit-status.exp | 17 ++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-)
Comments
On 09/03/2018 05:12 PM, Gary Benson wrote: > Pedro Alves <palves@redhat.com> wrote: >> Yeah, if we compare with gdb.base/quit.exp, that is missing >> as well as the "remote_close host" call. For the latter, when I last >> touched quit.exp, I remember fretting a bit about whether the remote_close >> was really necessary, but in the end decided to keep it, I don't recall >> exactly if I kept it because I found it's necessary (probably for >> remote hosts), or because it doesn't hurt. >> >> Now that I look at gdb.base/quit.exp again, I see that >> gdb.base/batch-exit-status.exp can hang forever in the same way that >> 15763a09d4ae fixed, isn't it? Gary, any reason you didn't do the >> "eof" thing here too? > > I didn't realize what it did; I thought it was something specific to > that test. And I thought the gdb_exit at the start of the test would > clear $gdb_spawn_id but apparently not! :) So I made a fix, basically > copied and pasted from the commit you referenced: > > This commit changes the batch exit status test to detect GDB's exit > using gdb_test_multiple expecting 'eof', instead of using 'wait'. > This fixes failures reported by buildbot on Fedora 28, and also means Please expand here what the failure was, for the logs. Something concise mentioning gdb_spawn_id, doesn't have to be long. It just should be more self contained so that someone reading back the logs later on understands what it was. > the testcase won't hang forever on failure as fixed in > gdb.base/quit.exp by commit 15763a09d4aea85fc3153d6746c040dd48565637. Please write the commit in Linux-commit-style: commit 15763a09d4ae ("Fix 'gdb.base/quit.exp hangs forever' if the test fails"). to help the human reading the logs. > Is this ok to commit? OK. Thanks, Pedro Alves
Pedro Alves wrote: > On 09/03/2018 05:12 PM, Gary Benson wrote: > > Pedro Alves <palves@redhat.com> wrote: > > > Yeah, if we compare with gdb.base/quit.exp, that is missing > > > as well as the "remote_close host" call. For the latter, when I last > > > touched quit.exp, I remember fretting a bit about whether the remote_close > > > was really necessary, but in the end decided to keep it, I don't recall > > > exactly if I kept it because I found it's necessary (probably for > > > remote hosts), or because it doesn't hurt. > > > > > > Now that I look at gdb.base/quit.exp again, I see that > > > gdb.base/batch-exit-status.exp can hang forever in the same way that > > > 15763a09d4ae fixed, isn't it? Gary, any reason you didn't do the > > > "eof" thing here too? > > > > I didn't realize what it did; I thought it was something specific to > > that test. And I thought the gdb_exit at the start of the test would > > clear $gdb_spawn_id but apparently not! :) So I made a fix, basically > > copied and pasted from the commit you referenced: > > > > This commit changes the batch exit status test to detect GDB's exit > > using gdb_test_multiple expecting 'eof', instead of using 'wait'. > > > This fixes failures reported by buildbot on Fedora 28, and also means > > Please expand here what the failure was, for the logs. Something concise > mentioning gdb_spawn_id, doesn't have to be long. It just should be more > self contained so that someone reading back the logs later on understands > what it was. > > > the testcase won't hang forever on failure as fixed in > > gdb.base/quit.exp by commit 15763a09d4aea85fc3153d6746c040dd48565637. > > Please write the commit in Linux-commit-style: > > commit 15763a09d4ae ("Fix 'gdb.base/quit.exp hangs forever' if > the test fails"). > > to help the human reading the logs. I've pushed the patch with the following message: Fix batch exit status test failure on Fedora 28 This commit adds calls to remote_close and clear_gdb_spawn_id to gdb.base/batch-exit-status.exp, fixing failures reported by buildbot on Fedora 28 where gdb_spawn_id not being reset by the previous test caused default_gdb_spawn to return without spawning. This commit also changes the test to use detect GDB's exit using gdb_test_multiple expecting 'eof', rather than using 'wait -i' alone. This means the testcase won't hang forever on failure as fixed in gdb.base/quit.exp by commit 15763a09d4ae ("Fix 'gdb.base/quit.exp hangs forever' if the test fails"). gdb/testsuite/ChangeLog: * gdb.base/batch-exit-status.exp: Use gdb_test_multiple and expect 'eof' before 'wait -i'. Use remote_close and clear_gdb_spawn_id. Thanks, Gary
diff --git a/gdb/testsuite/gdb.base/batch-exit-status.exp b/gdb/testsuite/gdb.base/batch-exit-status.exp index bee4d72..3b5de59 100644 --- a/gdb/testsuite/gdb.base/batch-exit-status.exp +++ b/gdb/testsuite/gdb.base/batch-exit-status.exp @@ -29,11 +29,18 @@ proc _test_exit_status {expect_status cmdline_opts} { return } - set result [wait -i $gdb_spawn_id] - verbose $result - gdb_assert { [lindex $result 2] == 0 } - set actual_status [lindex $result 3] - gdb_assert { $actual_status == $expect_status } + gdb_test_multiple "" "run til exit" { + eof { + set result [wait -i $gdb_spawn_id] + verbose $result + + gdb_assert { [lindex $result 2] == 0 } + gdb_assert { [lindex $result 3] == $expect_status } + + remote_close host + clear_gdb_spawn_id + } + } } proc test_exit_status {expect_status cmdline_opts} {