diff --git a/tests/common/environ.py b/tests/common/environ.py index c96571b7c..54ae8f093 100644 --- a/tests/common/environ.py +++ b/tests/common/environ.py @@ -413,7 +413,7 @@ class ImpalaTestClusterProperties(object): Checks if --hms_event_polling_interval_s is set to non-zero value""" try: key = "hms_event_polling_interval_s" - return key in self.catalogd_runtime_flags and int( + return key in self.catalogd_runtime_flags and float( self._catalogd_runtime_flags[key]["current"]) > 0 except Exception: if self.is_remote_cluster(): @@ -421,6 +421,22 @@ class ImpalaTestClusterProperties(object): LOG.exception( "Failed to get flags from web UI, assuming event polling is disabled") return False + raise + + def is_hierarchical_event_processing_enabled(self): + """Whether hierarchical event processing is enabled""" + try: + key = "enable_hierarchical_event_processing" + return self.is_event_polling_enabled() and key in self.catalogd_runtime_flags \ + and self.runtime_flags[key]["current"] == "true" + except Exception: + if self.is_remote_cluster(): + # IMPALA-8553: be more tolerant of failures on remote cluster builds. + LOG.exception( + "Failed to get flags from web UI, assuming hierarchical event processing is " + "disabled") + return False + raise def build_flavor_timeout(default_timeout, slow_build_timeout=None, asan_build_timeout=None, code_coverage_build_timeout=None): diff --git a/tests/custom_cluster/test_web_pages.py b/tests/custom_cluster/test_web_pages.py index b25b3c84c..67d702ff9 100644 --- a/tests/custom_cluster/test_web_pages.py +++ b/tests/custom_cluster/test_web_pages.py @@ -27,12 +27,14 @@ import time from tests.common.custom_cluster_test_suite import ( DEFAULT_CLUSTER_SIZE, CustomClusterTestSuite) +from tests.common.environ import ImpalaTestClusterProperties from tests.common.impala_connection import IMPALA_CONNECTION_EXCEPTION from tests.common.skip import SkipIfFS, SkipIfDockerizedCluster from tests.shell.util import run_impala_shell_cmd SMALL_QUERY_LOG_SIZE_IN_BYTES = 40 * 1024 CATALOG_URL = "http://localhost:25020/catalog" +IMPALA_TEST_CLUSTER_PROPERTIES = ImpalaTestClusterProperties.get_instance() class TestWebPage(CustomClusterTestSuite): @@ -495,8 +497,11 @@ class TestWebPage(CustomClusterTestSuite): json_res = json.loads(requests.get("http://localhost:25020/events?json").text) new_latest_event_id = json_res["progress-info"]["latest_event_id"] assert new_latest_event_id > old_latest_event_id - # Current event (the failed one) should not be cleared - assert "current_event" in json_res["progress-info"] + # Current event batch info is not shown when hierarchical event processing is + # enabled since events are dispatched and then processed in parallel. + if not IMPALA_TEST_CLUSTER_PROPERTIES.is_hierarchical_event_processing_enabled(): + # Current event (the failed one) should not be cleared + assert "current_event" in json_res["progress-info"] # Verify the error message disappears after a global INVALIDATE METADATA self.execute_query("invalidate metadata")