hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r891366 - in /hadoop/zookeeper/trunk: CHANGES.txt src/java/test/org/apache/zookeeper/test/ObserverTest.java
Date Wed, 16 Dec 2009 18:26:59 GMT
Author: phunt
Date: Wed Dec 16 18:26:58 2009
New Revision: 891366

URL: http://svn.apache.org/viewvc?rev=891366&view=rev
Log:
ZOOKEEPER-609. ObserverTest failure "zk should not be connected expected not same"

Modified:
    hadoop/zookeeper/trunk/CHANGES.txt
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ObserverTest.java

Modified: hadoop/zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=891366&r1=891365&r2=891366&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/CHANGES.txt (original)
+++ hadoop/zookeeper/trunk/CHANGES.txt Wed Dec 16 18:26:58 2009
@@ -158,16 +158,20 @@
 
   ZOOKEEPER-611. hudson build failure (take 2) (mahadev)
 
-  ZOOKEEPER-615. wrong javadoc for create with a sequence flag (mahadev via breed)
+  ZOOKEEPER-615. wrong javadoc for create with a sequence flag
+  (mahadev via breed)
 
   ZOOKEEPER-588. remove unnecessary/annoying log of tostring error in 
   Request.toString() (phunt via breed)
 
-  ZOOKEEPER-587.  client should log timeout negotiated with server (phunt via
-  mahadev)
+  ZOOKEEPER-587.  client should log timeout negotiated with server
+  (phunt via mahadev)
+
+  ZOOKEEPER-614. Improper synchronisation in getClientCnxnCount
+  (henry via mahadev) 
 
-  ZOOKEEPER-614. Improper synchronisation in getClientCnxnCount (henry via
-  mahadev) 
+  ZOOKEEPER-609. ObserverTest failure "zk should not be connected expected not
+  same" (henry robinson via phunt)
 
 IMPROVEMENTS:
   ZOOKEEPER-473. cleanup junit tests to eliminate false positives due to

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ObserverTest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ObserverTest.java?rev=891366&r1=891365&r2=891366&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ObserverTest.java (original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ObserverTest.java Wed Dec
16 18:26:58 2009
@@ -48,8 +48,7 @@
     protected static final Logger LOG =
         Logger.getLogger(ObserverTest.class);    
       
-    // We expect two notifications before we want to continue
-    CountDownLatch latch = new CountDownLatch(2);
+    CountDownLatch latch;
     ZooKeeper zk;
     WatchedEvent lastEvent = null;
           
@@ -64,6 +63,8 @@
     @Test
     public void testObserver() throws Exception {
         ClientBase.setupTestEnv();
+        // We expect two notifications before we want to continue        
+        latch = new CountDownLatch(2);
         
         final int PORT_QP1 = PortAssignment.unique();
         final int PORT_QP2 = PortAssignment.unique();
@@ -126,7 +127,8 @@
         
         // Now the resulting ensemble shouldn't be quorate         
         latch.await();        
-        assertNotSame("zk should not be connected", KeeperState.SyncConnected,lastEvent.getState());
+        assertNotSame("Client is still connected to non-quorate cluster", 
+                KeeperState.SyncConnected,lastEvent.getState());
 
         try {
             assertFalse("Shouldn't get a response when cluster not quorate!",
@@ -137,10 +139,11 @@
         }
         
         latch = new CountDownLatch(1);
-        
+
         // Bring it back
         q2 = new MainThread(2, CLIENT_PORT_QP2, quorumCfgSection);
         q2.start();
+        LOG.info("Waiting for server 2 to come up");
         assertTrue("waiting for server 2 being up",
                 ClientBase.waitForServerUp("localhost:" + CLIENT_PORT_QP2,
                         CONNECTION_TIMEOUT));
@@ -148,7 +151,8 @@
         latch.await();
         // It's possible our session expired - but this is ok, shows we 
         // were able to talk to the ensemble
-        assertTrue("Didn't reconnect", 
+        assertTrue("Client didn't reconnect to quorate ensemble (state was" +
+                lastEvent.getState() + ")",
                 (KeeperState.SyncConnected==lastEvent.getState() ||
                 KeeperState.Expired==lastEvent.getState())); 
                        
@@ -173,8 +177,9 @@
      * Implementation of watcher interface.
      */
     public void process(WatchedEvent event) {
-        latch.countDown();
         lastEvent = event;
+        latch.countDown();
+        LOG.info("Latch got event :: " + event);        
     }    
     
     /**



Mime
View raw message