This is an automated email from the ASF dual-hosted git repository. stigahuang pushed a commit to branch branch-4.1.1 in repository https://gitbox.apache.org/repos/asf/impala.git
commit a1a13c60d3365f5e87d798e1c18b4875ebde2405 Author: Gergely Fürnstáhl <[email protected]> AuthorDate: Fri Jun 24 15:25:34 2022 +0200 IMPALA-11391: Fixed race condition in test_drop_managed_kudu_table test_drop_managed_kudu_table uses exception to verify the deleted table is really missing. Depending on timing, this exception could have been raised in several control pathes with different content. Now the test waits for event processing, meaning Analyzer will consistently catch the missing table and raise the same exception. Change-Id: I857098c87fcd44d945dd33108bcfdfaa2ca939df Reviewed-on: http://gerrit.cloudera.org:8080/18667 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> Reviewed-on: http://gerrit.cloudera.org:8080/18893 Tested-by: Quanlong Huang <[email protected]> Reviewed-by: Quanlong Huang <[email protected]> --- tests/custom_cluster/test_kudu.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/custom_cluster/test_kudu.py b/tests/custom_cluster/test_kudu.py index 8fbc6c938..c706c984f 100644 --- a/tests/custom_cluster/test_kudu.py +++ b/tests/custom_cluster/test_kudu.py @@ -24,8 +24,9 @@ from time import sleep from tests.beeswax.impala_beeswax import ImpalaBeeswaxException from tests.common.custom_cluster_test_suite import CustomClusterTestSuite from tests.common.kudu_test_suite import KuduTestSuite -from tests.common.skip import SkipIfKudu, SkipIfHive3, SkipIfBuildType +from tests.common.skip import SkipIfKudu, SkipIfBuildType from tests.common.test_dimensions import add_exec_option_dimension +from tests.util.event_processor_utils import EventProcessorUtils KUDU_MASTER_HOSTS = pytest.config.option.kudu_master_hosts LOG = logging.getLogger(__name__) @@ -291,12 +292,16 @@ class TestKuduHMSIntegration(CustomKuduTest): assert kudu_client.table_exists(kudu_tbl_name) kudu_client.delete_table(kudu_tbl_name) assert not kudu_client.table_exists(kudu_tbl_name) + + # Wait for events to prevent race condition + EventProcessorUtils.wait_for_event_processing(self) + try: cursor.execute("DROP TABLE %s" % kudu_tbl_name) assert False except Exception as e: LOG.info(str(e)) - assert "Table %s no longer exists in the Hive MetaStore." % kudu_tbl_name in str(e) + "Table does not exist: %s" % kudu_tbl_name in str(e) @pytest.mark.execute_serially def test_drop_external_kudu_table(self, cursor, kudu_client, unique_database):
