Return-Path: Delivered-To: apmail-hadoop-zookeeper-commits-archive@minotaur.apache.org Received: (qmail 27303 invoked from network); 30 Jul 2009 22:33:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Jul 2009 22:33:56 -0000 Received: (qmail 34302 invoked by uid 500); 30 Jul 2009 22:33:57 -0000 Delivered-To: apmail-hadoop-zookeeper-commits-archive@hadoop.apache.org Received: (qmail 34274 invoked by uid 500); 30 Jul 2009 22:33:57 -0000 Mailing-List: contact zookeeper-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: zookeeper-dev@ Delivered-To: mailing list zookeeper-commits@hadoop.apache.org Received: (qmail 34264 invoked by uid 99); 30 Jul 2009 22:33:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Jul 2009 22:33:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Jul 2009 22:33:55 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0ED2D23888E4; Thu, 30 Jul 2009 22:33:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r799462 - in /hadoop/zookeeper/branches/branch-3.2: CHANGES.txt src/c/tests/TestClient.cc src/c/tests/TestClientRetry.cc Date: Thu, 30 Jul 2009 22:33:34 -0000 To: zookeeper-commits@hadoop.apache.org From: mahadev@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090730223335.0ED2D23888E4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mahadev Date: Thu Jul 30 22:33:34 2009 New Revision: 799462 URL: http://svn.apache.org/viewvc?rev=799462&view=rev Log: ZOOKEEPER-482. ignore sigpipe in testRetry to avoid silent immediate failure. (chris via mahadev) Modified: hadoop/zookeeper/branches/branch-3.2/CHANGES.txt hadoop/zookeeper/branches/branch-3.2/src/c/tests/TestClient.cc hadoop/zookeeper/branches/branch-3.2/src/c/tests/TestClientRetry.cc Modified: hadoop/zookeeper/branches/branch-3.2/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.2/CHANGES.txt?rev=799462&r1=799461&r2=799462&view=diff ============================================================================== --- hadoop/zookeeper/branches/branch-3.2/CHANGES.txt (original) +++ hadoop/zookeeper/branches/branch-3.2/CHANGES.txt Thu Jul 30 22:33:34 2009 @@ -16,6 +16,9 @@ ZOOKEEPER-467. Change log level in BookieHandle (flavio via mahadev) + ZOOKEEPER-482. ignore sigpipe in testRetry to avoid silent immediate +failure. (chris via mahadev) + IMPROVEMENTS: NEW FEATURES: Modified: hadoop/zookeeper/branches/branch-3.2/src/c/tests/TestClient.cc URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.2/src/c/tests/TestClient.cc?rev=799462&r1=799461&r2=799462&view=diff ============================================================================== --- hadoop/zookeeper/branches/branch-3.2/src/c/tests/TestClient.cc (original) +++ hadoop/zookeeper/branches/branch-3.2/src/c/tests/TestClient.cc Thu Jul 30 22:33:34 2009 @@ -19,6 +19,7 @@ #include #include "CppAssertHelper.h" +#include #include #include #include @@ -218,6 +219,12 @@ char cmd[1024]; sprintf(cmd, "%s startClean %s", ZKSERVER_CMD, getHostPorts()); CPPUNIT_ASSERT(system(cmd) == 0); + + struct sigaction act; + act.sa_handler = SIG_IGN; + sigemptyset(&act.sa_mask); + act.sa_flags = 0; + CPPUNIT_ASSERT(sigaction(SIGPIPE, &act, NULL) == 0); } Modified: hadoop/zookeeper/branches/branch-3.2/src/c/tests/TestClientRetry.cc URL: http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.2/src/c/tests/TestClientRetry.cc?rev=799462&r1=799461&r2=799462&view=diff ============================================================================== --- hadoop/zookeeper/branches/branch-3.2/src/c/tests/TestClientRetry.cc (original) +++ hadoop/zookeeper/branches/branch-3.2/src/c/tests/TestClientRetry.cc Thu Jul 30 22:33:34 2009 @@ -19,6 +19,7 @@ #include #include "CppAssertHelper.h" +#include #include #include #include @@ -200,19 +201,14 @@ char cmd[1024]; sprintf(cmd, "export ZKMAXCNXNS=1;%s startClean %s", ZKSERVER_CMD, getHostPorts()); CPPUNIT_ASSERT(system(cmd) == 0); - } - - void startServer() { - char cmd[1024]; - sprintf(cmd, "export ZKMAXCNXNS=1;%s start %s", ZKSERVER_CMD, getHostPorts()); - CPPUNIT_ASSERT(system(cmd) == 0); + struct sigaction act; + act.sa_handler = SIG_IGN; + sigemptyset(&act.sa_mask); + act.sa_flags = 0; + CPPUNIT_ASSERT(sigaction(SIGPIPE, &act, NULL) == 0); } - - void stopServer() { - tearDown(); - } - + void tearDown() { char cmd[1024]; @@ -228,13 +224,12 @@ return ctx->countEvents() > 0; } -#define COUNT 100 - static zhandle_t *async_zk; void testRetry() { watchctx_t ctx1, ctx2; + zoo_set_debug_level((ZooLogLevel)0); // disable logging zhandle_t *zk1 = createClient(&ctx1); CPPUNIT_ASSERT_EQUAL(true, ctx1.waitForConnected(zk1)); zhandle_t *zk2 = createClient(&ctx2);