Ver código fonte

HUE-3905 [beeswax] Reset beeswax.conf params in beeswax.tests:test_hiveserver2_jdbc_url

krish 9 anos atrás
pai
commit
dcdbc706f2
1 arquivos alterados com 7 adições e 3 exclusões
  1. 7 3
      apps/beeswax/src/beeswax/tests.py

+ 7 - 3
apps/beeswax/src/beeswax/tests.py

@@ -3380,10 +3380,12 @@ def test_apply_natural_sort():
                                                             {'name': 'test_200', 'comment': 'Test'}])
 
 def test_hiveserver2_jdbc_url():
-  try:
-    hostname = socket.getfqdn()
-    beeswax.conf.HIVE_SERVER_HOST.set_for_testing(hostname)
+  hostname = socket.getfqdn()
+  resets = [
+    beeswax.conf.HIVE_SERVER_HOST.set_for_testing(hostname),
     beeswax.conf.HIVE_SERVER_PORT.set_for_testing('10000')
+  ]
+  try:
     url = hiveserver2_jdbc_url()
     assert_equal(url, 'jdbc:hive2://' + hostname + ':10000/default')
 
@@ -3404,6 +3406,8 @@ def test_hiveserver2_jdbc_url():
     assert_equal(url, 'jdbc:hive2://server-with-ssl-enabled.com:10000/default')
   finally:
     beeswax.hive_site.reset()
+    for reset in resets:
+        reset()