From patchwork Tue Apr 5 21:11:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 89929 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id DAAD8B6EEE for ; Wed, 6 Apr 2011 07:11:52 +1000 (EST) Received: (qmail 9422 invoked by alias); 5 Apr 2011 21:11:51 -0000 Received: (qmail 9412 invoked by uid 22791); 5 Apr 2011 21:11:50 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Apr 2011 21:11:46 +0000 Received: from kpbe20.cbf.corp.google.com (kpbe20.cbf.corp.google.com [172.25.105.84]) by smtp-out.google.com with ESMTP id p35LBijD029575 for ; Tue, 5 Apr 2011 14:11:44 -0700 Received: from iyf13 (iyf13.prod.google.com [10.241.50.77]) by kpbe20.cbf.corp.google.com with ESMTP id p35LBhev008921 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 5 Apr 2011 14:11:43 -0700 Received: by iyf13 with SMTP id 13so806394iyf.28 for ; Tue, 05 Apr 2011 14:11:43 -0700 (PDT) Received: by 10.42.77.8 with SMTP id g8mr182683ick.478.1302037903004; Tue, 05 Apr 2011 14:11:43 -0700 (PDT) Received: from coign.google.com (adsl-71-133-8-30.dsl.pltn13.pacbell.net [71.133.8.30]) by mx.google.com with ESMTPS id gy41sm4695823ibb.22.2011.04.05.14.11.41 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Apr 2011 14:11:42 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: libgo patch committed: Add external timeout to gotest script Date: Tue, 05 Apr 2011 14:11:39 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch to the gotest test script adds an external timeout, which will kill a test if the internal timeout fails due to some problem in the runtime. This patch is imperfect in that it will leave a sleep command around after the test is complete. The sleep command will eventually terminate and disappear, but it would be nicer if it were killed sooner. Unfortunately I don't see a convenient way to do that. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r 03d5aa32694e libgo/testsuite/gotest --- a/libgo/testsuite/gotest Tue Apr 05 12:52:06 2011 -0700 +++ b/libgo/testsuite/gotest Tue Apr 05 14:04:59 2011 -0700 @@ -377,7 +377,20 @@ xno) ${GC} -g -c _testmain.go ${GL} *.o ${GOLIBS} - ./a.out -test.short -test.timeout=$timeout "$@" + + ./a.out -test.short -test.timeout=$timeout "$@" & + pid=$! + (sleep `expr $timeout + 10` + echo > gotest-timeout + echo "timed out in gotest" 1>&2 + kill -9 $pid) & + alarmpid=$! + wait $pid + status=$? + if ! test -f gotest-timeout; then + kill $alarmpid + fi + exit $status ;; xyes) rm -rf ../testsuite/*.o