hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
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 GMT
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 <cppunit/extensions/HelperMacros.h>
 #include "CppAssertHelper.h"
 
+#include <signal.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/select.h>
@@ -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 <cppunit/extensions/HelperMacros.h>
 #include "CppAssertHelper.h"
 
+#include <signal.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/select.h>
@@ -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);



Mime
View raw message