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-14608 testWalRollOnLowReplication has some risk to assert failed after HBASE-14600 (Heng Chen)
Date Thu, 15 Oct 2015 06:02:26 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 46f287738 -> d6f3dae7e


HBASE-14608 testWalRollOnLowReplication has some risk to assert failed after HBASE-14600 (Heng
Chen)


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

Branch: refs/heads/master
Commit: d6f3dae7e7f821d4861a1cfb1a5a145469ef2bf7
Parents: 46f2877
Author: stack <stack@apache.org>
Authored: Wed Oct 14 23:02:17 2015 -0700
Committer: stack <stack@apache.org>
Committed: Wed Oct 14 23:02:17 2015 -0700

----------------------------------------------------------------------
 .../procedure/TestWALProcedureStoreOnHDFS.java  | 32 +++++++++++++-------
 1 file changed, 21 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d6f3dae7/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java
index 3d39504..8712c80 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java
@@ -72,6 +72,17 @@ public class TestWALProcedureStoreOnHDFS {
 
   private WALProcedureStore store;
 
+  private ProcedureStore.ProcedureStoreListener stopProcedureListener = new ProcedureStore.ProcedureStoreListener()
{
+    @Override
+    public void postSync() {}
+
+    @Override
+    public void abortProcess() {
+      LOG.fatal("Abort the Procedure Store");
+      store.stop(true);
+    }
+  };
+
   private static void setupConf(Configuration conf) {
     conf.setInt("dfs.replication", 3);
     conf.setInt("dfs.namenode.replication.min", 3);
@@ -90,16 +101,7 @@ public class TestWALProcedureStoreOnHDFS {
     Path logDir = new Path(new Path(dfs.getFileSystem().getUri()), "/test-logs");
     store = ProcedureTestingUtility.createWalStore(
       UTIL.getConfiguration(), dfs.getFileSystem(), logDir);
-    store.registerListener(new ProcedureStore.ProcedureStoreListener() {
-      @Override
-      public void postSync() {}
-
-      @Override
-      public void abortProcess() {
-        LOG.fatal("Abort the Procedure Store");
-        store.stop(true);
-      }
-    });
+    store.registerListener(stopProcedureListener);
     store.start(8);
     store.recoverLease();
   }
@@ -137,7 +139,6 @@ public class TestWALProcedureStoreOnHDFS {
   @Test(timeout=60000)
   public void testWalAbortOnLowReplicationWithQueuedWriters() throws Exception {
     assertEquals(3, UTIL.getDFSCluster().getDataNodes().size());
-
     store.registerListener(new ProcedureStore.ProcedureStoreListener() {
       @Override
       public void postSync() {
@@ -183,6 +184,15 @@ public class TestWALProcedureStoreOnHDFS {
 
   @Test(timeout=60000)
   public void testWalRollOnLowReplication() throws Exception {
+    store.unregisterListener(stopProcedureListener);
+    store.registerListener(new ProcedureStore.ProcedureStoreListener() {
+      @Override
+      public void postSync() {}
+
+      @Override
+      public void abortProcess() {
+      }
+    });
     int dnCount = 0;
     store.insert(new TestProcedure(1, -1), null);
     UTIL.getDFSCluster().restartDataNode(dnCount);


Mime
View raw message