Repository: ranger
Updated Branches:
  refs/heads/ranger-0.7 be582b59c -> bf29570d0


RANGER-1375: HIVERangerAuthorizerTest UT fails intermittently

Signed-off-by: Velmurugan Periasamy <v...@apache.org>
(cherry picked from commit 74905128f0ed9c7dd16c4f9bf353b624a343fc46)


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

Branch: refs/heads/ranger-0.7
Commit: bf29570d00db51e9ca6cfc27d7043b3ce10af1d8
Parents: be582b5
Author: Sailaja Polavarapu <spolavar...@hortonworks.com>
Authored: Fri Feb 10 16:31:03 2017 -0800
Committer: Velmurugan Periasamy <v...@apache.org>
Committed: Sun Feb 12 22:16:10 2017 -0500

----------------------------------------------------------------------
 .../ranger/services/hive/HIVERangerAuthorizerTest.java | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/bf29570d/hive-agent/src/test/java/org/apache/ranger/services/hive/HIVERangerAuthorizerTest.java
----------------------------------------------------------------------
diff --git 
a/hive-agent/src/test/java/org/apache/ranger/services/hive/HIVERangerAuthorizerTest.java
 
b/hive-agent/src/test/java/org/apache/ranger/services/hive/HIVERangerAuthorizerTest.java
index 9b22794..35f7f0b 100644
--- 
a/hive-agent/src/test/java/org/apache/ranger/services/hive/HIVERangerAuthorizerTest.java
+++ 
b/hive-agent/src/test/java/org/apache/ranger/services/hive/HIVERangerAuthorizerTest.java
@@ -80,12 +80,6 @@ public class HIVERangerAuthorizerTest {
 
         conf.set(HiveConf.ConfVars.METASTORE_AUTO_CREATE_ALL.varname, "true");
         conf.set(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_PORT.varname, "" + 
port);
-
-        // Enable authorization
-        conf.set(HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED.varname, "true");
-        conf.set(HiveConf.ConfVars.HIVE_SERVER2_ENABLE_DOAS.varname, "true");
-        conf.set(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER.varname,
-                 
"org.apache.ranger.authorization.hive.authorizer.RangerHiveAuthorizerFactory");
         conf.set(HiveConf.ConfVars.METASTORE_SCHEMA_VERIFICATION.toString(), 
"false");
 
         hiveServer = new HiveServer2();
@@ -128,6 +122,13 @@ public class HIVERangerAuthorizerTest {
 
         statement.close();
         connection.close();
+        
+        // Enable ranger authorization after the initial db setup and table 
creating is done.
+        conf.set(HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED.varname, "true");
+        conf.set(HiveConf.ConfVars.HIVE_SERVER2_ENABLE_DOAS.varname, "true");
+        conf.set(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER.varname,
+                 
"org.apache.ranger.authorization.hive.authorizer.RangerHiveAuthorizerFactory");
+        
     }
 
     @org.junit.AfterClass

Reply via email to