You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2018/04/29 07:05:57 UTC

hive git commit: HIVE-19313 : TestJdbcWithDBTokenStoreNoDoAs tests are failing (Peter Vary via Ashutosh Chauhan)

Repository: hive
Updated Branches:
  refs/heads/master 9caab816f -> 95bdb2b1a


HIVE-19313 : TestJdbcWithDBTokenStoreNoDoAs tests are failing (Peter Vary via Ashutosh Chauhan)

Signed-off-by: Ashutosh Chauhan <ha...@apache.org>


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

Branch: refs/heads/master
Commit: 95bdb2b1afd7cb4b7680e70a7f3175b9740f5d06
Parents: 9caab81
Author: Ashutosh Chauhan <ha...@apache.org>
Authored: Sun Apr 29 00:05:22 2018 -0700
Committer: Ashutosh Chauhan <ha...@apache.org>
Committed: Sun Apr 29 00:05:22 2018 -0700

----------------------------------------------------------------------
 .../apache/hive/minikdc/TestJdbcWithDBTokenStore.java  | 13 +++++++++++++
 .../hive/minikdc/TestJdbcWithDBTokenStoreNoDoAs.java   |  8 ++++++++
 2 files changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/95bdb2b1/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStore.java
----------------------------------------------------------------------
diff --git a/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStore.java b/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStore.java
index 7805332..272c745 100644
--- a/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStore.java
+++ b/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStore.java
@@ -20,6 +20,7 @@ package org.apache.hive.minikdc;
 
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
+import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
 import org.apache.hive.jdbc.miniHS2.MiniHS2;
 import org.junit.BeforeClass;
 
@@ -46,5 +47,17 @@ public class TestJdbcWithDBTokenStore extends TestJdbcWithMiniKdc{
     String hs2Principal = miniHS2.getConfProperty(ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL.varname);
     String hs2KeyTab = miniHS2.getConfProperty(ConfVars.HIVE_SERVER2_KERBEROS_KEYTAB.varname);
     System.out.println("HS2 principal : " + hs2Principal + " HS2 keytab : " + hs2KeyTab + " Metastore principal : " + metastorePrincipal);
+    System.setProperty(HiveConf.ConfVars.METASTOREWAREHOUSE.varname,
+        MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.WAREHOUSE));
+    System.setProperty(HiveConf.ConfVars.METASTORECONNECTURLKEY.varname,
+        MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.CONNECT_URL_KEY));
+    // Before this patch, the Embedded MetaStore was used here not the one started by the MiniHS2
+    // The below 3 lines would change the tests to use the Remote MetaStore, but it will cause a
+    // failure. By removing the thrift MetaStore uris, the tests are passing again.
+    // I think this is an valid problem here, but not really sure about the
+    // tests original intention, so keep everything as it was originally.
+//    System.setProperty(HiveConf.ConfVars.METASTOREURIS.varname,
+//        MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.THRIFT_URIS));
+//    Thread.sleep(2000);
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/95bdb2b1/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStoreNoDoAs.java
----------------------------------------------------------------------
diff --git a/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStoreNoDoAs.java b/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStoreNoDoAs.java
index 538be4a..5b7fb7e 100644
--- a/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStoreNoDoAs.java
+++ b/itests/hive-minikdc/src/test/java/org/apache/hive/minikdc/TestJdbcWithDBTokenStoreNoDoAs.java
@@ -20,6 +20,7 @@ package org.apache.hive.minikdc;
 
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
+import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
 import org.apache.hive.jdbc.miniHS2.MiniHS2;
 import org.junit.BeforeClass;
 
@@ -46,5 +47,12 @@ public class TestJdbcWithDBTokenStoreNoDoAs extends TestJdbcWithMiniKdc{
     String hs2Principal = miniHS2.getConfProperty(ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL.varname);
     String hs2KeyTab = miniHS2.getConfProperty(ConfVars.HIVE_SERVER2_KERBEROS_KEYTAB.varname);
     System.out.println("HS2 principal : " + hs2Principal + " HS2 keytab : " + hs2KeyTab + " Metastore principal : " + metastorePrincipal);
+    System.setProperty(HiveConf.ConfVars.METASTOREWAREHOUSE.varname,
+        MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.WAREHOUSE));
+    System.setProperty(HiveConf.ConfVars.METASTORECONNECTURLKEY.varname,
+        MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.CONNECT_URL_KEY));
+    System.setProperty(HiveConf.ConfVars.METASTOREURIS.varname,
+        MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.THRIFT_URIS));
+    Thread.sleep(2000);
   }
 }
\ No newline at end of file