From patchwork Thu Jun 27 19:14:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 33460 Received: (qmail 85456 invoked by alias); 27 Jun 2019 19:14:32 -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 85405 invoked by uid 89); 27 Jun 2019 19:14:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=UD:options.exp, options.exp, optionsexp, U*palves 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; Thu, 27 Jun 2019 19:14:30 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB600C04BD4A for ; Thu, 27 Jun 2019 19:14:29 +0000 (UTC) Received: from localhost.localdomain (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67324600CC for ; Thu, 27 Jun 2019 19:14:29 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 1/5] Fix test_gdb_complete_tab_multiple race Date: Thu, 27 Jun 2019 20:14:23 +0100 Message-Id: <20190627191427.20742-2-palves@redhat.com> In-Reply-To: <20190627191427.20742-1-palves@redhat.com> References: <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 * 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" + } + } } } }