From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15029 invoked by alias); 3 May 2011 17:50:56 -0000 Received: (qmail 15017 invoked by uid 22791); 3 May 2011 17:50:55 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 May 2011 17:50:40 +0000 Received: (qmail 26769 invoked from network); 3 May 2011 17:50:39 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 May 2011 17:50:39 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [PATCH] gdb.base/pr10179.exp: fix racy tests (PR testsuite/12649) Date: Tue, 03 May 2011 17:50:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.6.2; x86_64; ; ) Cc: Marek Polacek References: <4DBEE73B.3040202@redhat.com> <201105022024.01156.pedro@codesourcery.com> <4DC032F1.3030705@redhat.com> In-Reply-To: <4DC032F1.3030705@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201105031850.46894.pedro@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2011-05/txt/msg00070.txt.bz2 On Tuesday 03 May 2011 17:53:05, Marek Polacek wrote: > > For instance, break.exp doesn't appear to > > need to match the whole question. > > In break.exp, there are no `gdb_test "delete breakpoints"'. Right, I was refering its first test: "delete breakpoints". It doesn't use gdb_test, but I didn't know what was doing on within gdb_test itself that was causing the race you were seeing. > > Not sure the original PR 10179 had something to do with > > deleting breakpoints, otherwise, there's a delete_breakpoints > > procedure tests can use to do this. > > I think the best thing here is to make use of the `delete_breakpoints', since > pr10179.exp addresses to test the `rbreak', not deleting the breakpoints. > Replacing `gdb_test "delete breakpoints"' with delete_breakpoints also > cures the races. IIUC, the race was caused by this part: > > "Delete all breakpoints.*" "y" > > Thus, when using read1(), we match the question "Delete all breakpoints? > (y or n)" right after the "breakpoints" word. This will leave in the buffer > "? (y or n)". The "(y or n)" matches and causes the "interactive prompt" fail. You're assuming I already knew the fail was of "interactive prompt" kind. :-) I didn't, but I now ran the test and see the failure. Seeing this also helps review: FAIL: gdb.base/pr10179.exp: delete breakpoints (got interactive prompt) FAIL: gdb.base/pr10179.exp: rbreak pr10179-a.c:foo.* FAIL: gdb.base/pr10179.exp: rbreak pr10179-a.c : .* (got interactive prompt) Knowing all this, your original patch was indeed trivial. > > Here is a better patch. Tested with both read{,1}. OK now? Thanks, > > 2011-05-03 Marek Polacek > > * gdb.base/pr10179.exp: Get rid of races using `delete_breakpoints' > in place of `gdb_test "delete breakpoints"'. This eliminates two > testcases. Okay, thanks, this is even better. -- Pedro Alves