hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-14472 TestHCM and TestRegionServerNoMaster fixes
Date Wed, 23 Sep 2015 18:46:19 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 0fa48ae56 -> 744a40917


HBASE-14472 TestHCM and TestRegionServerNoMaster fixes

Conflicts:
	hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/744a4091
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/744a4091
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/744a4091

Branch: refs/heads/branch-1
Commit: 744a40917c886fe88203aae76d1bb5a0ea50cd6d
Parents: 0fa48ae
Author: stack <stack@apache.org>
Authored: Wed Sep 23 10:13:48 2015 -0700
Committer: stack <stack@apache.org>
Committed: Wed Sep 23 11:45:57 2015 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/client/TestHCM.java |  2 +-
 .../regionserver/TestRegionServerNoMaster.java  | 11 ++++++----
 .../hbase/regionserver/TestWALLockup.java       | 21 ++++++++++++++------
 3 files changed, 23 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/744a4091/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java
index fbb6e51..49b2dbf 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java
@@ -340,7 +340,7 @@ public class TestHCM {
     // We want to work on a separate connection.
     c2.set(HConstants.HBASE_CLIENT_INSTANCE_ID, String.valueOf(-1));
     c2.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 100); // retry a lot
-    c2.setInt(HConstants.HBASE_CLIENT_PAUSE, 0); // don't wait between retries.
+    c2.setInt(HConstants.HBASE_CLIENT_PAUSE, 1); // don't wait between retries.
     c2.setInt(RpcClient.FAILED_SERVER_EXPIRY_KEY, 0); // Server do not really expire
     c2.setBoolean(RpcClient.SPECIFIC_WRITE_THREAD, allowsInterrupt);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/744a4091/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java
index da7d150..d295170 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java
@@ -42,6 +42,7 @@ import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.CloseRegionRequest
 import org.apache.hadoop.hbase.regionserver.handler.OpenRegionHandler;
 import org.apache.hadoop.hbase.util.Threads;
 import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread;
+import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.zookeeper.ZKAssign;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.KeeperException.NodeExistsException;
@@ -92,12 +93,14 @@ public class TestRegionServerNoMaster {
 
   public static void stopMasterAndAssignMeta(HBaseTestingUtility HTU)
       throws NodeExistsException, KeeperException, IOException, InterruptedException {
-    // No master
-    HTU.getHBaseCluster().getMaster().stopMaster();
+    // Stop master
+    HMaster master = HTU.getHBaseCluster().getMaster();
+    Thread masterThread = HTU.getHBaseCluster().getMasterThread();
+    ServerName masterAddr = master.getServerName();
+    master.stopMaster();
 
     Log.info("Waiting until master thread exits");
-    while (HTU.getHBaseCluster().getMasterThread() != null
-        && HTU.getHBaseCluster().getMasterThread().isAlive()) {
+    while (masterThread != null && masterThread.isAlive()) {
       Threads.sleep(100);
     }
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/744a4091/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java
index ce70682..d9670e7 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALLockup.java
@@ -20,6 +20,7 @@ package org.apache.hadoop.hbase.regionserver;
 
 
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -243,8 +244,8 @@ public class TestWALLockup {
           try {
             region.flush(false);
           } catch (IOException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
+            LOG.info("In flush", e);
+            fail();
           }
         };
       };
@@ -256,13 +257,21 @@ public class TestWALLockup {
       assertTrue(originalWAL != dodgyWAL.getCurrentFileName());
       // Can I append to it?
       dodgyWAL.throwException = false;
-      region.put(put);
+      try {
+        region.put(put);
+      } catch (Exception e) {
+        LOG.info("In the put", e);
+      }
     } finally {
       // To stop logRoller, its server has to say it is stopped.
       Mockito.when(server.isStopped()).thenReturn(true);
       if (logRoller != null) logRoller.interrupt();
-      if (region != null) region.close();
-      if (dodgyWAL != null) dodgyWAL.close();
+      try {
+        if (region != null) region.close();
+        if (dodgyWAL != null) dodgyWAL.close();
+      } catch (Exception e) {
+        LOG.info("On way out", e);
+      }
     }
   }
 
@@ -276,4 +285,4 @@ public class TestWALLockup {
       getName(), CONF, false, Durability.SYNC_WAL,
       wal, COLUMN_FAMILY_BYTES);
   }
-}
\ No newline at end of file
+}


Mime
View raw message