You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2020/03/12 05:48:41 UTC
[hbase] branch master updated: HBASE-23956 Use less resources
running tests (#1266) Addendum: TestNamespaceCommands was using up the
limit on nioeventloopgroup.... so create them per run of client.
This is an automated email from the ASF dual-hosted git repository.
stack pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/master by this push:
new d42e976 HBASE-23956 Use less resources running tests (#1266) Addendum: TestNamespaceCommands was using up the limit on nioeventloopgroup.... so create them per run of client.
d42e976 is described below
commit d42e9768d081fe20092130d874f3f229570b3a58
Author: stack <st...@apache.org>
AuthorDate: Wed Mar 11 22:45:14 2020 -0700
HBASE-23956 Use less resources running tests (#1266)
Addendum: TestNamespaceCommands was using up the limit on
nioeventloopgroup.... so create them per run of client.
---
.../hbase/security/access/TestNamespaceCommands.java | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestNamespaceCommands.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestNamespaceCommands.java
index 417c5f8..5ba9f10 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestNamespaceCommands.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestNamespaceCommands.java
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -20,7 +20,6 @@ package org.apache.hadoop.hbase.security.access;
import static org.apache.hadoop.hbase.AuthUtil.toGroupEntry;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-
import com.google.protobuf.BlockingRpcChannel;
import java.util.Arrays;
import java.util.List;
@@ -42,6 +41,7 @@ import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment;
import org.apache.hadoop.hbase.coprocessor.ObserverContextImpl;
+import org.apache.hadoop.hbase.ipc.NettyRpcClientConfigHelper;
import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService;
import org.apache.hadoop.hbase.security.User;
import org.apache.hadoop.hbase.security.access.Permission.Action;
@@ -56,7 +56,6 @@ import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import org.apache.hbase.thirdparty.com.google.common.collect.ListMultimap;
@Category({SecurityTests.class, MediumTests.class})
@@ -164,9 +163,13 @@ public class TestNamespaceCommands extends SecureTestUtil {
UTIL.getMiniHBaseCluster().getLiveRegionServerThreads()) {
ACCESS_CONTROLLER = rst.getRegionServer().getRegionServerCoprocessorHost().
findCoprocessor(AccessController.class);
- if (ACCESS_CONTROLLER != null) break;
+ if (ACCESS_CONTROLLER != null) {
+ break;
+ }
+ }
+ if (ACCESS_CONTROLLER == null) {
+ throw new NullPointerException();
}
- if (ACCESS_CONTROLLER == null) throw new NullPointerException();
UTIL.getAdmin().createNamespace(NamespaceDescriptor.create(TEST_NAMESPACE).build());
UTIL.getAdmin().createNamespace(NamespaceDescriptor.create(TEST_NAMESPACE2).build());
@@ -355,9 +358,12 @@ public class TestNamespaceCommands extends SecureTestUtil {
assertEquals(0, ((List)USER_GROUP_WRITE.runAs(listAction)).size());
}
- @Test
+ @SuppressWarnings("checkstyle:MethodLength") @Test
public void testGrantRevoke() throws Exception {
final String testUser = "testUser";
+ // Set this else in test context, with limit on the number of threads for
+ // netty eventloopgroup, we can run out of threads if one group used throughout.
+ NettyRpcClientConfigHelper.createEventLoopPerClient(conf);
// Test if client API actions are authorized
AccessTestAction grantAction = new AccessTestAction() {
@Override