hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r922459 - in /hadoop/zookeeper/trunk: ./ src/java/main/org/apache/zookeeper/server/quorum/ src/java/test/org/apache/zookeeper/server/quorum/ src/java/test/org/apache/zookeeper/test/
Date Sat, 13 Mar 2010 00:06:55 GMT
Author: phunt
Date: Sat Mar 13 00:06:55 2010
New Revision: 922459

URL: http://svn.apache.org/viewvc?rev=922459&view=rev
Log:
ZOOKEEPER-698. intermittent JMX test failures due to not verifying QuorumPeer shutdown

Modified:
    hadoop/zookeeper/trunk/CHANGES.txt
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerMain.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLENewEpochTest.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLERestartTest.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLETest.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLEZeroWeightTest.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/HierarchicalQuorumTest.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/LENonTerminateTest.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ObserverHierarchicalQuorumTest.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ObserverQuorumHammerTest.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ObserverTest.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumBase.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumTest.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/TruncateTest.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ZkDatabaseCorruptionTest.java

Modified: hadoop/zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/CHANGES.txt (original)
+++ hadoop/zookeeper/trunk/CHANGES.txt Sat Mar 13 00:06:55 2010
@@ -276,6 +276,9 @@ BUGFIXES: 
   ZOOKEEPER-121. SyncRequestProcessor is not closing log stream during
   shutdown (mahadev)
 
+  ZOOKEEPER-698. intermittent JMX test failures due to not verifying QuorumPeer
+  shutdown (phunt)
+
 IMPROVEMENTS:
   ZOOKEEPER-473. cleanup junit tests to eliminate false positives due to
   "socket reuse" and failure to close client (phunt via mahadev)

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java
(original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java
Sat Mar 13 00:06:55 2010
@@ -20,9 +20,9 @@
 package org.apache.zookeeper.server.quorum;
 
 import java.nio.ByteBuffer;
-import java.util.Map;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Map;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
 

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerMain.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerMain.java?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerMain.java
(original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerMain.java
Sat Mar 13 00:06:55 2010
@@ -63,7 +63,7 @@ public class QuorumPeerMain {
 
     private static final String USAGE = "Usage: QuorumPeerMain configfile";
 
-    private QuorumPeer quorumPeer;
+    protected QuorumPeer quorumPeer;
 
     /**
      * To start the replicated server specify the configuration file name on
@@ -147,8 +147,4 @@ public class QuorumPeerMain {
           LOG.warn("Quorum Peer interrupted", e);
       }
     }
-
-    protected void shutdown() {
-        quorumPeer.shutdown();
-    }
 }

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java
(original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java
Sat Mar 13 00:06:55 2010
@@ -21,12 +21,6 @@ package org.apache.zookeeper.server.quor
 import static org.apache.zookeeper.test.ClientBase.CONNECTION_TIMEOUT;
 
 import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStreamReader;
 import java.io.LineNumberReader;
 import java.io.StringReader;
 import java.net.InetSocketAddress;
@@ -34,20 +28,15 @@ import java.nio.ByteBuffer;
 import java.nio.channels.SocketChannel;
 import java.util.regex.Pattern;
 
-import junit.framework.TestCase;
-
 import org.apache.log4j.Layout;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.apache.log4j.WriterAppender;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.PortAssignment;
-import org.apache.zookeeper.WatchedEvent;
-import org.apache.zookeeper.Watcher;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.test.ClientBase;
-import org.apache.zookeeper.test.ClientTest;
 import org.junit.Test;
 
 
@@ -56,13 +45,6 @@ import org.junit.Test;
  *
  */
 public class QuorumPeerMainTest extends QuorumPeerTestBase {
-   
-    public static  class TestQPMain extends QuorumPeerMain {
-        public void shutdown() {
-            super.shutdown();
-        }
-    }
-
     /**
      * Verify the ability to start a cluster.
      */

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java
(original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java
Sat Mar 13 00:06:55 2010
@@ -25,13 +25,13 @@ import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
 
+import junit.framework.TestCase;
+
 import org.apache.log4j.Logger;
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
-import org.apache.zookeeper.server.quorum.QuorumPeerMainTest.TestQPMain;
 import org.apache.zookeeper.test.ClientBase;
-
-import junit.framework.TestCase;
+import org.apache.zookeeper.test.QuorumBase;
 
 /**
  * Has some common functionality for tests that work with QuorumPeers.
@@ -44,7 +44,14 @@ public class QuorumPeerTestBase extends 
     public void process(WatchedEvent event) {
         // ignore for this test
     }
-    
+
+    public static  class TestQPMain extends QuorumPeerMain {
+        public void shutdown() {
+            // ensure it closes - in particular wait for thread to exit
+            QuorumBase.shutdown(quorumPeer);
+        }
+    }
+
     public static class MainThread extends Thread {
         final File confFile;
         final TestQPMain main;

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLENewEpochTest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLENewEpochTest.java?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLENewEpochTest.java (original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLENewEpochTest.java Sat
Mar 13 00:06:55 2010
@@ -134,8 +134,7 @@ public class FLENewEpochTest extends Tes
                         break;
                     case 2:
                         LOG.info("Third peer, shutting it down");
-                        ((FastLeaderElection) peer.getElectionAlg()).shutdown();
-                        peer.shutdown();
+                        QuorumBase.shutdown(peer);
                         flag = false;
                         round[2] = 1;
                         finish3.release();

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLERestartTest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLERestartTest.java?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLERestartTest.java (original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLERestartTest.java Sat
Mar 13 00:06:55 2010
@@ -133,7 +133,7 @@ public class FLERestartTest extends Test
                     case 0:
                         if(peerRound == 0){
                             LOG.info("First peer, shutting it down");
-                            peer.shutdown();
+                            QuorumBase.shutdown(peer);
                             ((FastLeaderElection) restartThreads.get(i).peer.getElectionAlg()).shutdown();
 
                             peer = new QuorumPeer(peers, tmpdir[i], tmpdir[i], port[i], 3,
i, 2, 2, 2);

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLETest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLETest.java?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLETest.java (original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLETest.java Sat Mar 13
00:06:55 2010
@@ -92,8 +92,7 @@ public class FLETest extends TestCase {
     public void tearDown() throws Exception {
         for (int i = 0; i < threads.size(); i++) {
             leThread = threads.get(i);
-            ((FastLeaderElection) leThread.peer.getElectionAlg()).shutdown();
-            leThread.peer.shutdown();
+            QuorumBase.shutdown(leThread.peer);
         }
         LOG.info("FINISHED " + getName());
     }

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLEZeroWeightTest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLEZeroWeightTest.java?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLEZeroWeightTest.java
(original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/FLEZeroWeightTest.java
Sat Mar 13 00:06:55 2010
@@ -91,11 +91,10 @@ public class FLEZeroWeightTest extends T
     protected void tearDown() throws Exception {
         for(int i = 0; i < threads.size(); i++) {
             LEThread leThread = threads.get(i);
-            ((FastLeaderElection) leThread.peer.getElectionAlg()).shutdown();
             // shutdown() has to be explicitly called for every thread to
             // make sure that resources are freed properly and all fixed network ports
             // are available for other test cases
-            leThread.peer.shutdown();
+            QuorumBase.shutdown(leThread.peer);
         }
         LOG.info("FINISHED " + getName());
     }

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/HierarchicalQuorumTest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/HierarchicalQuorumTest.java?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/HierarchicalQuorumTest.java
(original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/HierarchicalQuorumTest.java
Sat Mar 13 00:06:55 2010
@@ -29,7 +29,6 @@ import java.util.Set;
 import org.apache.log4j.Logger;
 import org.apache.zookeeper.PortAssignment;
 import org.apache.zookeeper.TestableZooKeeper;
-import org.apache.zookeeper.server.quorum.FastLeaderElection;
 import org.apache.zookeeper.server.quorum.QuorumPeer;
 import org.apache.zookeeper.server.quorum.QuorumPeer.QuorumServer;
 import org.apache.zookeeper.server.quorum.flexible.QuorumHierarchical;
@@ -271,18 +270,7 @@ public class HierarchicalQuorumTest exte
     }
 
     protected void shutdown(QuorumPeer qp) {
-        try {
-            ((FastLeaderElection) qp.getElectionAlg()).shutdown();
-            LOG.info("Done with leader election");
-            qp.shutdown();
-            LOG.info("Done with quorum peer");
-            qp.join(30000);
-            if (qp.isAlive()) {
-                fail("QP failed to shutdown in 30 seconds");
-            }
-        } catch (InterruptedException e) {
-            LOG.debug("QP interrupted", e);
-        }
+        QuorumBase.shutdown(qp);
     }
 
     protected TestableZooKeeper createClient()

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/LENonTerminateTest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/LENonTerminateTest.java?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/LENonTerminateTest.java
(original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/LENonTerminateTest.java
Sat Mar 13 00:06:55 2010
@@ -35,14 +35,11 @@ import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
 import org.apache.zookeeper.PortAssignment;
-import org.apache.zookeeper.jmx.MBeanRegistry;
 import org.apache.zookeeper.server.NIOServerCnxn;
 import org.apache.zookeeper.server.quorum.Election;
 import org.apache.zookeeper.server.quorum.LeaderElection;
-import org.apache.zookeeper.server.quorum.LeaderElectionBean;
 import org.apache.zookeeper.server.quorum.QuorumPeer;
 import org.apache.zookeeper.server.quorum.Vote;
-import org.apache.zookeeper.server.quorum.LeaderElection.ElectionResult;
 import org.apache.zookeeper.server.quorum.QuorumPeer.LearnerType;
 import org.apache.zookeeper.server.quorum.QuorumPeer.QuorumServer;
 import org.apache.zookeeper.server.quorum.QuorumPeer.ServerState;

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ObserverHierarchicalQuorumTest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ObserverHierarchicalQuorumTest.java?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ObserverHierarchicalQuorumTest.java
(original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ObserverHierarchicalQuorumTest.java
Sat Mar 13 00:06:55 2010
@@ -37,19 +37,7 @@ public class ObserverHierarchicalQuorumT
     }
            
     protected void shutdown(QuorumPeer qp) {
-        try {
-            /* TODO: when Observers are compatible with fle, shutdown
-             * the leader election */            
-            LOG.info("Done with leader election");
-            qp.shutdown();
-            LOG.info("Done with quorum peer");
-            qp.join(30000);
-            if (qp.isAlive()) {
-                fail("QP failed to shutdown in 30 seconds");
-            }
-        } catch (InterruptedException e) {
-            LOG.debug("QP interrupted", e);
-        }
+        QuorumBase.shutdown(qp);
     }
 
     @Test

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ObserverQuorumHammerTest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ObserverQuorumHammerTest.java?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ObserverQuorumHammerTest.java
(original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ObserverQuorumHammerTest.java
Sat Mar 13 00:06:55 2010
@@ -17,7 +17,6 @@
  */
 
 package org.apache.zookeeper.test;
-import org.apache.log4j.Logger;
 import org.junit.Before;
 import org.junit.Test;
 

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=922459&r1=922458&r2=922459&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 Sat Mar
13 00:06:55 2010
@@ -20,8 +20,6 @@ package org.apache.zookeeper.test;
 
 import static org.apache.zookeeper.test.ClientBase.CONNECTION_TIMEOUT;
 
-import java.io.File;
-import java.io.FileWriter;
 import java.io.IOException;
 import java.util.concurrent.CountDownLatch;
 
@@ -35,9 +33,7 @@ import org.apache.zookeeper.KeeperExcept
 import org.apache.zookeeper.Watcher.Event.KeeperState;
 import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.ZooKeeper.States;
-import org.apache.zookeeper.server.quorum.QuorumPeerConfig;
 import org.apache.zookeeper.server.quorum.QuorumPeerTestBase;
-import org.apache.zookeeper.server.quorum.QuorumPeerConfig.ConfigException;
 import org.junit.Test;
 
 /**

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumBase.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumBase.java?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumBase.java (original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumBase.java Sat Mar
13 00:06:55 2010
@@ -30,7 +30,7 @@ import java.util.Set;
 import org.apache.log4j.Logger;
 import org.apache.zookeeper.PortAssignment;
 import org.apache.zookeeper.TestableZooKeeper;
-import org.apache.zookeeper.server.quorum.FastLeaderElection;
+import org.apache.zookeeper.server.quorum.Election;
 import org.apache.zookeeper.server.quorum.QuorumPeer;
 import org.apache.zookeeper.server.quorum.QuorumPeer.LearnerType;
 import org.apache.zookeeper.server.quorum.QuorumPeer.QuorumServer;
@@ -284,16 +284,24 @@ public class QuorumBase extends ClientBa
         shutdown(s5);
     }
 
-    protected void shutdown(QuorumPeer qp) {
+    public static void shutdown(QuorumPeer qp) {
         try {
+            LOG.info("Shutting down quorum peer " + qp.getName());
             qp.shutdown();
-            ((FastLeaderElection) qp.getElectionAlg()).shutdown();
+            Election e = qp.getElectionAlg();
+            if (e != null) {
+                LOG.info("Shutting down leader election " + qp.getName());
+                e.shutdown();
+            } else {
+                LOG.info("No election available to shutdown " + qp.getName());
+            }
+            LOG.info("Waiting for " + qp.getName() + " to exit thread");
             qp.join(30000);
             if (qp.isAlive()) {
-                fail("QP failed to shutdown in 30 seconds");
+                fail("QP failed to shutdown in 30 seconds: " + qp.getName());
             }
         } catch (InterruptedException e) {
-            LOG.debug("QP interrupted", e);
+            LOG.debug("QP interrupted: " + qp.getName(), e);
         }
     }
 

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumTest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumTest.java?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumTest.java (original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/QuorumTest.java Sat Mar
13 00:06:55 2010
@@ -30,8 +30,8 @@ import org.apache.zookeeper.ZooDefs;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.data.Stat;
-import org.apache.zookeeper.server.quorum.LearnerHandler;
 import org.apache.zookeeper.server.quorum.Leader;
+import org.apache.zookeeper.server.quorum.LearnerHandler;
 import org.junit.Before;
 import org.junit.Test;
 

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/TruncateTest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/TruncateTest.java?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/TruncateTest.java (original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/TruncateTest.java Sat Mar
13 00:06:55 2010
@@ -132,11 +132,8 @@ public class TruncateTest extends TestCa
             // this is what we want
         }
         zk1.close();
-        s1.shutdown();
-        s1.join();
-        s2.shutdown();
-        s2.join();
-        s3.shutdown();
-        s3.join();
+        QuorumBase.shutdown(s1);
+        QuorumBase.shutdown(s2);
+        QuorumBase.shutdown(s3);
     }
 }

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ZkDatabaseCorruptionTest.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ZkDatabaseCorruptionTest.java?rev=922459&r1=922458&r2=922459&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ZkDatabaseCorruptionTest.java
(original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ZkDatabaseCorruptionTest.java
Sat Mar 13 00:06:55 2010
@@ -19,13 +19,8 @@
 package org.apache.zookeeper.test;
 
 import java.io.File;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.RandomAccessFile;
-import java.net.InetSocketAddress;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.Set;
 
 import org.apache.log4j.Logger;
 import org.apache.zookeeper.CreateMode;
@@ -36,8 +31,6 @@ import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.server.SyncRequestProcessor;
 import org.apache.zookeeper.server.persistence.FileTxnSnapLog;
 import org.apache.zookeeper.server.quorum.QuorumPeer;
-import org.apache.zookeeper.server.quorum.QuorumPeer.LearnerType;
-import org.apache.zookeeper.server.quorum.QuorumPeer.QuorumServer;
 import org.apache.zookeeper.server.quorum.QuorumPeer.ServerState;
 import org.junit.Before;
 
@@ -122,10 +115,10 @@ public class ZkDatabaseCorruptionTest ex
             zk.create("/0-" + i, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
         }
         zk.close();
-        qb.s1.shutdown();
-        qb.s2.shutdown();
-        qb.s3.shutdown();
-        qb.s4.shutdown();
+        QuorumBase.shutdown(qb.s1);
+        QuorumBase.shutdown(qb.s2);
+        QuorumBase.shutdown(qb.s3);
+        QuorumBase.shutdown(qb.s4);
     } 
 
     



Mime
View raw message