diff --git a/tests/custom_cluster/test_local_catalog.py b/tests/custom_cluster/test_local_catalog.py index 14a9a54..a8a4881 100644 --- a/tests/custom_cluster/test_local_catalog.py +++ b/tests/custom_cluster/test_local_catalog.py @@ -21,6 +21,7 @@ import pytest import random import threading import time +import Queue from tests.common.custom_cluster_test_suite import CustomClusterTestSuite @@ -203,15 +204,21 @@ class TestCompactCatalogUpdates(CustomClusterTestSuite): replans_seen = [0] replans_seen_lock = threading.Lock() + # Queue to propagate exceptions from failed queries, if any. + failed_queries = Queue.Queue() + def stress_thread(client): while replans_seen[0] == 0: # TODO(todd) EXPLAIN queries don't currently yield a profile, so # we have to actually run a COUNT query. q = random.choice([ - 'refresh functional.alltypes', + 'invalidate metadata functional.alltypes', 'select count(*) from functional.alltypes where month=4', 'select count(*) from functional.alltypes where month=5']) - ret = self.execute_query_expect_success(client, q) + try: + ret = self.execute_query_expect_success(client, q) + except Exception as e: + failed_queries.put((q, str(e))) if RETRY_PROFILE_MSG in ret.runtime_profile: with replans_seen_lock: replans_seen[0] += 1 @@ -221,7 +228,9 @@ class TestCompactCatalogUpdates(CustomClusterTestSuite): for t in threads: t.start() for t in threads: - t.join(30) + t.join(120) + if not failed_queries.empty(): + assert False, "Failed query count non zero: %s" % list(failed_queries.queue) assert replans_seen[0] > 0, "Did not trigger any re-plans" finally: