From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8883 invoked by alias); 19 Feb 2012 18:46:23 -0000 Received: (qmail 8871 invoked by uid 22791); 19 Feb 2012 18:46:20 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 19 Feb 2012 18:46:01 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1JIk09R022743 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 19 Feb 2012 13:46:00 -0500 Received: from host2.jankratochvil.net (ovpn-116-21.ams2.redhat.com [10.36.116.21]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q1JIjuoV024095 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 19 Feb 2012 13:45:59 -0500 Date: Mon, 20 Feb 2012 02:41:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: Pedro Alves , gdb-patches@sourceware.org Subject: [patch] testsuite: Fix inferior-died.exp racy FAILs [Re: RFC: fix crash when inferior exits during "continue"] Message-ID: <20120219184555.GA18014@host2.jankratochvil.net> References: <20120210144040.GA28038@host2.jankratochvil.net> <87ty2ya1ys.fsf@fleche.redhat.com> <20120214134417.GA6730@redhat.com> <4F3A6D51.5010904@redhat.com> <87d39fn9cq.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87d39fn9cq.fsf@fleche.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2012-02/txt/msg00391.txt.bz2 On Wed, 15 Feb 2012 21:13:25 +0100, Tom Tromey wrote: > 2012-02-15 Tom Tromey > > * gdb.base/inferior-died.c: New file. > * gdb.base/inferior-died.exp: New file. It has racy FAILs: continue Continuing. -[Inferior 2 (process 17329) exited normally] -(gdb) PASS: gdb.base/inferior-died.exp: continue -testcase ./gdb.base/inferior-died.exp completed in 2 seconds +[Inferior 2 (process 17248) exited normally] +(gdb) [Inferior 1 (process 17243) exited with code 0140] +FAIL: gdb.base/inferior-died.exp: continue (timeout) +testcase ./gdb.base/inferior-died.exp completed in 11 seconds I will check in this fix in some days. Thanks, Jan gdb/testsuite/ 2012-02-19 Jan Kratochvil Fix racy FAILs. * gdb.base/inferior-died.c (main): Add return of 0. * gdb.base/inferior-died.exp (continue): Fix expectation of asynchronous events. (p 1): New test. --- a/gdb/testsuite/gdb.base/inferior-died.c +++ b/gdb/testsuite/gdb.base/inferior-died.c @@ -33,4 +33,5 @@ int main() function (); else waitpid (child, NULL, 0); + return 0; } --- a/gdb/testsuite/gdb.base/inferior-died.exp +++ b/gdb/testsuite/gdb.base/inferior-died.exp @@ -53,4 +53,19 @@ gdb_breakpoint $srcfile:$line gdb_continue_to_breakpoint "breakpoint" gdb_test "inferior 2" "Switching to inferior 2.*" -gdb_test "continue" "exited normally.*" + +# The inferior 1 exit may come unexpectedly in any moment. +set test "continue" +set seen 0 +gdb_test_multiple $test $test { + -re "($gdb_prompt |\\\[Inferior \[^\r\n\]* exited normally\\\])" { + incr seen + if {$seen < 3} { + exp_continue + } + pass $test + } +} + +# Internal error may show up after all the messages above. +gdb_test "p 1" " = 1"