From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8499 invoked by alias); 23 Jul 2019 08:26:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 8486 invoked by uid 89); 23 Jul 2019 08:26:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=UD:gdb.log, gdblog, gdb.log X-HELO: mail-wm1-f43.google.com Received: from mail-wm1-f43.google.com (HELO mail-wm1-f43.google.com) (209.85.128.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Jul 2019 08:26:53 +0000 Received: by mail-wm1-f43.google.com with SMTP id v19so37674847wmj.5 for ; Tue, 23 Jul 2019 01:26:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=U/0HkS3vSF+MU2fWA14TaZdjGiJHQH2hfzBKZwUbu+o=; b=Qbd2RUIp9bgRsgsll07jazJuAPBrZaoSJdzZidmq1K+dSdYmwye8i3G/FjDkRI0SqO ObI3fynWWOhb1X3Jq33ElUYV/g78UMDZX4wbZBPGjwsvQtbVPJcW6ZJCMbzD6tI3Pgu1 T/DVSmcqZs88/9TVkVg2aUhY4z/51pz5dZ5xS2tfKdWUOGhj6xkMOAOJ8tXQfJADZrLu NMxUt+XcvT+FJjJb9TNySLSfxD4wtcQnVWaH0IsmRg+zQttWXcYKdPb95aWSgctLjDdQ on6l/EDK9Cl9b7X0A75ENlDflOTaeQx8ZDKrx9nq+fpPWTwWBgoXi6EbyA24tBXkxigK hYPw== Return-Path: Received: from localhost (host86-128-12-79.range86-128.btcentralplus.com. [86.128.12.79]) by smtp.gmail.com with ESMTPSA id p12sm32682787wrt.13.2019.07.23.01.26.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2019 01:26:50 -0700 (PDT) Date: Tue, 23 Jul 2019 08:26:00 -0000 From: Andrew Burgess To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH][gdb/testsuite] Fix command result testing in mi-complete.exp Message-ID: <20190723082649.GF23204@embecosm.com> References: <20190723075010.GA27426@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190723075010.GA27426@delia> X-Fortune: A gift of a flower will soon be made to you. X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00533.txt.bz2 * Tom de Vries [2019-07-23 09:50:12 +0200]: > Hi, > > When running gdb.mi/mi-complete.exp in conjunction with: > ... > $ stress -c $(($(cat /proc/cpuinfo | grep -c "^processor") + 1)) > ... > we get less than 50% full passes: > ... > $ for n in $(seq 1 100); do \ > make V=1 -O check \ > 'RUNTESTFLAGS=gdb.mi/mi-complete.exp --target_board=unix'; \ > done 2>&1 \ > | grep "expected passes" | sort | uniq -c > 45 # of expected passes 7 > 9 # of expected passes 8 > 46 # of expected passes 9 > ... > > A diff between a passing and failing gdb.log shows this difference: > ... > -&"set max-completions 1\n" > 2-complete br > +&"set max-completions 1\n" > ... > > The problem is that the test-case issues the "set max-completion " command, > and without waiting for the output issues a next command, and tries to parse > the results of both commands, expecting a specific interleaving of the various > output streams. > > Fix the FAIL by waiting for the result of the "set max-completion " command > before issuing another command. > > Tested on x86_64-linux. > > OK for trunk? Looks good to me. Thanks, Andrew > > Thanks, > - Tom > > [gdb/testsuite] Fix command result testing in mi-complete.exp > > gdb/testsuite/ChangeLog: > > 2019-07-23 Tom de Vries > > PR testsuite/24711 > * gdb.mi/mi-complete.exp: Wait for "set max-completions" result before > issuing next command. > > --- > gdb/testsuite/gdb.mi/mi-complete.exp | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/gdb/testsuite/gdb.mi/mi-complete.exp b/gdb/testsuite/gdb.mi/mi-complete.exp > index 692b004fd9..5b9613548f 100644 > --- a/gdb/testsuite/gdb.mi/mi-complete.exp > +++ b/gdb/testsuite/gdb.mi/mi-complete.exp > @@ -58,14 +58,16 @@ mi_gdb_test "-info-gdb-mi-command complete" \ > > # Limit max completions and check that max_completions_reached=\"0\" is set > # to 1. > -send_gdb "set max-completions 1\n" > +mi_gdb_test "set max-completions 1" ".*=cmd-param-changed.*\\^done" \ > + "set max-completions 1" > > mi_gdb_test "2-complete br" \ > ".*2\\^done,completion=\"br\[A-Za-z0-9-\]+\",matches=\\\[\"br\[A-Za-z0-9-\]+\"\\\],max_completions_reached=\"1\"" \ > "-complete br, max-completions 1" > > # Disable completions and check an error is returned > -send_gdb "set max-completions 0\n" > +mi_gdb_test "set max-completions 0" ".*=cmd-param-changed.*\\^done" \ > + "set max-completions 0" > > mi_gdb_test "3-complete br" \ > ".*3\\^error,msg=\".*" \