This is an automated email from the ASF dual-hosted git repository. stigahuang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/impala.git
commit 086e0b0ffa4abf284b52a3267e078f357e47de0a Author: jasonmfehr <[email protected]> AuthorDate: Fri Dec 13 12:58:02 2024 -0800 IMPALA-13603: Fix Flaky Live Queries Table Tests Workload management skips recording successful trivial DDLs but does not skip recording failed trivial DDLs. The test_query_live.py tests run a describe DDL in the setup_method(). Normally, this describe succeeds immediately and thus is not recorded in the workload management tables. However, in very rare instances, the describe DDL will fail the first time and succeed the second time. These cases result in an extra query recorded in the sys.impala_query_live table and test assertions that rely on a certain number of records being in this table fail because there are extra records. This change modifies the method used to determine if the sys.impala_query_live table is available. The test_query_live.py tests now check the coordinator's catalog cache and wait until the sys.impala_query_live table appears. DDLs are no longer executed. All tests in the test_query_live.py file passed locally and in Jenkins builds. Change-Id: I767a2bd7b068ab3fdeddb7cb3c4b307844d2d279 Reviewed-on: http://gerrit.cloudera.org:8080/22210 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- tests/custom_cluster/test_query_live.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/custom_cluster/test_query_live.py b/tests/custom_cluster/test_query_live.py index 134cfb9a1..be16ea512 100644 --- a/tests/custom_cluster/test_query_live.py +++ b/tests/custom_cluster/test_query_live.py @@ -24,6 +24,7 @@ from getpass import getuser from signal import SIGRTMIN from tests.common.custom_cluster_test_suite import CustomClusterTestSuite from tests.common.impala_cluster import DEFAULT_KRPC_PORT +from tests.util.retry import retry from tests.util.workload_management import assert_query from time import sleep @@ -34,8 +35,14 @@ class TestQueryLive(CustomClusterTestSuite): def setup_method(self, method): super(TestQueryLive, self).setup_method(method) self.wait_for_wm_init_complete() - # Wait few seconds until sys.impala_query_live is queryable. - self.wait_for_table_to_appear('sys', 'impala_query_live', 30) + + # Wait until sys.impala_query_live is available in the coordinator's catalog cache. + def table_exists(last_iteration): + catalog_objs = self.cluster.get_first_impalad() \ + .service.read_debug_webpage("catalog?json") + return "impala_query_live" in catalog_objs + + assert retry(func=table_exists, max_attempts=5, sleep_time_s=3, backoff=1) def assert_describe_extended(self): describe_ext_result = self.execute_query('describe extended sys.impala_query_live')
