From patchwork Tue Oct 24 22:26:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 23788 Received: (qmail 106662 invoked by alias); 24 Oct 2017 22:26:19 -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 106229 invoked by uid 89); 24 Oct 2017 22:26:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Oct 2017 22:26:17 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0F39881DE3 for ; Tue, 24 Oct 2017 22:26:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0F39881DE3 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from cascais.lan (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8DC395DA66 for ; Tue, 24 Oct 2017 22:26:15 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed] Fix racy test in gdb.base/new-ui.exp Date: Tue, 24 Oct 2017 23:26:14 +0100 Message-Id: <1508883974-5147-1-git-send-email-palves@redhat.com> I noticed gdb.base/new-ui.exp failing once here with: FAIL: gdb.base/new-ui.exp: do_test: delete all breakpoints on extra console (got interactive prompt) FAIL: gdb.base/new-ui.exp: do_test: main console: next causes no spurious output on other console FAIL: gdb.base/new-ui.exp: do_test: main console: breakpoint hit reported on other console The problem is 100% reproducible with check-read1: $ make check-read1 TESTS="gdb.*/new-ui.exp" testsuite/gdb.log shows: delete Delete all breakpoints? (y or n) [answered Y; input not from terminal] (gdb) FAIL: gdb.base/new-ui.exp: do_test: delete all breakpoints on extra console (got interactive prompt) This commit fixes the problem. gdb/testsuite/ChangeLog: 2017-10-24 Pedro Alves * gdb.base/new-ui.exp (do_test): Split "delete all breakpoints on extra console" test in two stages. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.base/new-ui.exp | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d9ed687..0c6c93a 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2017-10-24 Pedro Alves + * gdb.base/new-ui.exp (do_test): Split "delete all breakpoints on + extra console" test in two stages. + +2017-10-24 Pedro Alves + * gdb.threads/attach-into-signal.exp (corefunc): Reindent. 2017-10-24 Pedro Alves diff --git a/gdb/testsuite/gdb.base/new-ui.exp b/gdb/testsuite/gdb.base/new-ui.exp index b84f4de..f9a1851 100644 --- a/gdb/testsuite/gdb.base/new-ui.exp +++ b/gdb/testsuite/gdb.base/new-ui.exp @@ -135,9 +135,18 @@ proc_with_prefix do_test {} { "Delete all breakpoints. .y or n. $" "n" } with_spawn_id $extra_spawn_id { - gdb_test "delete" \ - "Delete all breakpoints. .y or n. .answered Y; input not from terminal." \ - "delete all breakpoints on extra console" + # Check output in two stages in order to override + # gdb_test_multiple's internal "got interactive prompt" fail + # that would otherwise match if the expect buffer happens to + # fill with partial output that ends in "(y or n) ". + set test "delete all breakpoints on extra console" + gdb_test_multiple "delete" $test { + -re "Delete all breakpoints. .y or n. " { + gdb_test "" \ + ".answered Y; input not from terminal." \ + $test + } + } } # Run a few execution tests with the main console as the driver