Browse Source

HUE-6157 [core] Fix various live cluster tests

Jenny Kim 8 years ago
parent
commit
6f577a3091

+ 7 - 4
apps/impala/src/impala/test_impala_flags.py

@@ -30,9 +30,12 @@ LOG = logging.getLogger(__name__)
 
 def test_impala_flags():
   test_impala_conf_dir = tempfile.mkdtemp()
-  finish = None
+  resets = []
 
   try:
+    if conf.QUERYCACHE_ROWS.get() != 50000:
+      resets.append(conf.QUERYCACHE_ROWS.set_for_testing(50000))
+
     assert_equal(conf.QUERYCACHE_ROWS.get(), 50000)
     assert_equal(conf.IMPERSONATION_ENABLED.get(), False)
 
@@ -44,7 +47,7 @@ def test_impala_flags():
     """
     file(os.path.join(test_impala_conf_dir, 'impalad_flags'), 'w').write(flags)
 
-    finish = conf.IMPALA_CONF_DIR.set_for_testing(test_impala_conf_dir)
+    resets.append(conf.IMPALA_CONF_DIR.set_for_testing(test_impala_conf_dir))
     impala_flags.reset()
 
     assert_equal(impala_flags.get_webserver_certificate_file(), '/etc/test-ssl-conf/CA_STANDARD/impala-cert.pem')
@@ -57,5 +60,5 @@ def test_impala_flags():
     assert_equal(conf.IMPERSONATION_ENABLED.get(), True)
   finally:
     impala_flags.reset()
-    if finish:
-      finish()
+    for reset in resets:
+      reset()

+ 3 - 1
desktop/libs/libsolr/src/libsolr/tests.py

@@ -38,7 +38,9 @@ try:
   # App can be blacklisted
   from search.conf import SOLR_URL
   from search.models import Collection2
+  search_enabled = True
 except:
+  search_enabled = False
   LOG.exception('Testing libsolr requires the search app to not be blacklisted')
 
 
@@ -47,7 +49,7 @@ class TestLibSolrWithSolr:
   @classmethod
   def setup_class(cls):
 
-    if not is_live_cluster():
+    if not is_live_cluster() or not search_enabled:
       raise SkipTest
 
     cls.client = make_logged_in_client(username='test', is_superuser=False)

+ 2 - 2
desktop/libs/notebook/src/notebook/connectors/tests/tests_hiveserver2.py

@@ -810,7 +810,7 @@ class TestHiveserver2ApiWithHadoop(BeeswaxSampleProvider):
       statement = "SELECT * FROM web_logs;"
       doc = self.create_query_document(owner=self.user, query_type='impala', statement=statement)
       notebook = Notebook(document=doc)
-      snippet = self.execute_and_wait(doc, snippet_idx=0, timeout=60.0, wait=2.0)
+      snippet = self.execute_and_wait(doc, snippet_idx=0, timeout=60.0, wait=5.0)
 
       self.client.post(reverse('notebook:fetch_result_data'),
                        {'notebook': notebook.get_json(), 'snippet': json.dumps(snippet), 'rows': 100, 'startOver': 'false'})
@@ -840,7 +840,7 @@ class TestHiveserver2ApiWithHadoop(BeeswaxSampleProvider):
       statement = "SELECT * FROM web_logs;"
       doc = self.create_query_document(owner=self.user, query_type='impala', statement=statement)
       notebook = Notebook(document=doc)
-      snippet = self.execute_and_wait(doc, snippet_idx=0, timeout=60.0, wait=2.0)
+      snippet = self.execute_and_wait(doc, snippet_idx=0, timeout=60.0, wait=5.0)
 
       self.client.post(reverse('notebook:fetch_result_data'),
                        {'notebook': notebook.get_json(), 'snippet': json.dumps(snippet), 'rows': 100, 'startOver': 'false'})