hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [3/4] hbase git commit: HBASE-21258 Add resetting of flags for RS Group pre/post hooks in TestRSGroups
Date Tue, 02 Oct 2018 00:11:10 GMT
HBASE-21258 Add resetting of flags for RS Group pre/post hooks in TestRSGroups

Amending-Author: Andrew Purtell <apurtell@apache.org>


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

Branch: refs/heads/branch-1.4
Commit: 0918e8f3f16cb386a2b76bb2616d6e688d916e6f
Parents: 8e8650b
Author: tedyu <yuzhihong@gmail.com>
Authored: Mon Oct 1 15:07:59 2018 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Mon Oct 1 17:04:49 2018 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/rsgroup/TestRSGroups.java      | 26 ++++++++++++++------
 1 file changed, 19 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/0918e8f3/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java
----------------------------------------------------------------------
diff --git a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java
b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java
index 4320fea..50d9c8c 100644
--- a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java
+++ b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroups.java
@@ -123,7 +123,7 @@ public class TestRSGroups extends TestRSGroupsBase {
       init = true;
       afterMethod();
     }
-
+    observer.resetFlags();
   }
 
   @After
@@ -149,7 +149,7 @@ public class TestRSGroups extends TestRSGroupsBase {
     } catch (Exception ex) {
       // ignore
     }
-    assertTrue(observer.preMoveServersCalled);
+
     TEST_UTIL.waitFor(WAIT_TIMEOUT, new Waiter.Predicate<Exception>() {
       @Override
       public boolean evaluate() throws Exception {
@@ -222,9 +222,6 @@ public class TestRSGroups extends TestRSGroupsBase {
     String groupName = tablePrefix+"_foo";
     LOG.info("testNamespaceConstraint");
     rsGroupAdmin.addRSGroup(groupName);
-    assertTrue(observer.preAddRSGroupCalled);
-    assertTrue(observer.postAddRSGroupCalled);
-
     admin.createNamespace(NamespaceDescriptor.create(nsName)
         .addConfiguration(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP, groupName)
         .build());
@@ -245,8 +242,6 @@ public class TestRSGroups extends TestRSGroupsBase {
     //test add non-existent group
     admin.deleteNamespace(nsName);
     rsGroupAdmin.removeRSGroup(groupName);
-    assertTrue(observer.preRemoveRSGroupCalled);
-    assertTrue(observer.postRemoveRSGroupCalled);
     try {
       admin.createNamespace(NamespaceDescriptor.create(nsName)
           .addConfiguration(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP, "foo")
@@ -283,6 +278,23 @@ public class TestRSGroups extends TestRSGroupsBase {
     boolean preMoveServersAndTables = false;
     boolean postMoveServersAndTables = false;
 
+    void resetFlags() {
+      preBalanceRSGroupCalled = false;
+      postBalanceRSGroupCalled = false;
+      preMoveServersCalled = false;
+      postMoveServersCalled = false;
+      preMoveTablesCalled = false;
+      postMoveTablesCalled = false;
+      preAddRSGroupCalled = false;
+      postAddRSGroupCalled = false;
+      preRemoveRSGroupCalled = false;
+      postRemoveRSGroupCalled = false;
+      preRemoveServersCalled = false;
+      postRemoveServersCalled = false;
+      preMoveServersAndTables = false;
+      postMoveServersAndTables = false;
+    }
+
     @Override
     public void preMoveServersAndTables(final ObserverContext<MasterCoprocessorEnvironment>
ctx,
         Set<Address> servers, Set<TableName> tables, String targetGroup) throws
IOException {


Mime
View raw message