Selaa lähdekoodia

[impala] Check if creating the impala test databases had failed

On Kerberos, it's possible for the tests to fail with some
mysterious errors just say that a QueryHistory object had
not been created. This is happening because the Hue test
user may not necessarily have permission to write to these
tables. This patch doesn't fix the error, it just surfaces
the real problem being that creating these tables is failing.
Erick Tryzelaar 10 vuotta sitten
vanhempi
commit
008bf6f320
2 muutettua tiedostoa jossa 10 lisäystä ja 1 poistoa
  1. 4 1
      apps/beeswax/src/beeswax/test_base.py
  2. 6 0
      apps/impala/src/impala/tests.py

+ 4 - 1
apps/beeswax/src/beeswax/test_base.py

@@ -214,7 +214,10 @@ def wait_for_query_to_finish(client, response, max=60.0):
 
 def is_finished(response):
   status = json.loads(response.content)
-  return 'error' in status or status.get('isSuccess') or status.get('isFailure')
+  return 'error' in status \
+      or status.get('isSuccess') \
+      or status.get('isFailure') \
+      or status.get('status') == -1
 
 
 def fetch_query_result_data(client, status_response, n=0, server_name='beeswax'):

+ 6 - 0
apps/impala/src/impala/tests.py

@@ -130,6 +130,9 @@ class TestImpalaIntegration:
     resp = _make_query(cls.client, hql, database='default', local=False, server_name='impala')
     resp = wait_for_query_to_finish(cls.client, resp, max=180.0)
 
+    content = json.loads(resp.content)
+    assert_true(content['status'] == 0, resp.content)
+
     hql = """
       CREATE TABLE tweets (row_num INTEGER, id_str STRING, text STRING) STORED AS PARQUET;
 
@@ -143,6 +146,9 @@ class TestImpalaIntegration:
     resp = _make_query(cls.client, hql, database=cls.DATABASE, local=False, server_name='impala')
     resp = wait_for_query_to_finish(cls.client, resp, max=180.0)
 
+    content = json.loads(resp.content)
+    assert_true(content['status'] == 0, resp.content)
+
   @classmethod
   def teardown_class(cls):
     # We need to drop tables before dropping the database