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 e0cb533c252b003e9034808140119313ce9eeb4b
Author: Mihaly Szjatinya <[email protected]>
AuthorDate: Fri Jun 13 15:20:17 2025 +0200

    IMPALA-13912: Use SHARED_CLUSTER_ARGS in more custom cluster tests
    
    In addition to IMPALA-13503 which allowed having the single cluster
    running for the entire test class, this attempts to minimize restarting
    between the existing tests without modifying any of their code.
    
    This changeset saves the command line with which
    'start-impala-cluster.py' has been run and skips the restarting if the
    command line is the same for the next test.
    
    Some tests however do require restart due to the specific metrics being
    tested. Such tests are defined with the 'force_restart' flag within the
    'with_args' decorator. NOTE: there might be more tests like that
    revealed after running the tests in different order resulting in test
    failures.
    
    Experimentally, this results in ~150 fewer restarts, mostly coming from
    restarts between tests. As for restarts between different variants of
    the same test, most of the cluster tests are restricted to single
    variant, although multi-variant tests occur occasionally.
    
    Change-Id: I7c9115d4d47b9fe0bfd9dbda218aac2fb02dbd09
    Reviewed-on: http://gerrit.cloudera.org:8080/22901
    Reviewed-by: Impala Public Jenkins <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 tests/common/custom_cluster_test_suite.py          | 50 ++++++++++++++++++++--
 tests/custom_cluster/test_admission_controller.py  |  8 ++--
 tests/custom_cluster/test_codegen_cache.py         | 26 +++++------
 tests/custom_cluster/test_kill_query.py            |  1 +
 tests/custom_cluster/test_krpc_metrics.py          |  3 +-
 tests/custom_cluster/test_kudu.py                  |  7 +++
 tests/custom_cluster/test_local_catalog.py         |  3 +-
 tests/custom_cluster/test_query_log.py             |  9 ++--
 tests/custom_cluster/test_query_retries.py         |  5 ++-
 tests/custom_cluster/test_restart_services.py      |  3 +-
 tests/custom_cluster/test_shell_interactive.py     |  1 +
 .../test_shell_interactive_reconnect.py            |  2 +
 12 files changed, 90 insertions(+), 28 deletions(-)

diff --git a/tests/common/custom_cluster_test_suite.py 
b/tests/common/custom_cluster_test_suite.py
index dfe6f10a9..f39072050 100644
--- a/tests/common/custom_cluster_test_suite.py
+++ b/tests/common/custom_cluster_test_suite.py
@@ -80,6 +80,7 @@ DISABLE_LOG_BUFFERING = 'disable_log_buffering'
 # paths to stderr.
 LOG_SYMLINKS = 'log_symlinks'
 WORKLOAD_MGMT = 'workload_mgmt'
+FORCE_RESTART = 'force_restart'
 
 # Args that accept additional formatting to supply temporary dir path.
 ACCEPT_FORMATTING = set([IMPALAD_ARGS, CATALOGD_ARGS, IMPALA_LOG_DIR])
@@ -98,6 +99,7 @@ WORKLOAD_MGMT_IMPALAD_FLAGS = (
   '--enable_workload_mgmt=true --query_log_write_interval_s=1 '
   '--shutdown_grace_period_s=0 --shutdown_deadline_s=60 ')
 
+PREVIOUS_CMD_STR = ""
 
 class CustomClusterTestSuite(ImpalaTestSuite):
   """Runs tests with a custom Impala cluster. There are two modes:
@@ -156,7 +158,7 @@ class CustomClusterTestSuite(ImpalaTestSuite):
       impalad_timeout_s=None, expect_cores=None, reset_ranger=False,
       tmp_dir_placeholders=[],
       expect_startup_fail=False, disable_log_buffering=False, 
log_symlinks=False,
-      workload_mgmt=False):
+      workload_mgmt=False, force_restart=False):
     """Records arguments to be passed to a cluster by adding them to the 
decorated
     method's func_dict"""
     args = dict()
@@ -200,6 +202,8 @@ class CustomClusterTestSuite(ImpalaTestSuite):
       args[LOG_SYMLINKS] = True
     if workload_mgmt:
       args[WORKLOAD_MGMT] = True
+    if force_restart:
+      args[FORCE_RESTART] = True
 
     def merge_args(args_first, args_last):
       result = args_first.copy()
@@ -334,6 +338,14 @@ class CustomClusterTestSuite(ImpalaTestSuite):
       kwargs[STATESTORED_TIMEOUT_S] = args[STATESTORED_TIMEOUT_S]
     if IMPALAD_TIMEOUT_S in args:
       kwargs[IMPALAD_TIMEOUT_S] = args[IMPALAD_TIMEOUT_S]
+    if FORCE_RESTART in args:
+      kwargs[FORCE_RESTART] = args[FORCE_RESTART]
+      if args[FORCE_RESTART] is True:
+        LOG.warning("Test uses force_restart=True to avoid restarting the 
cluster. "
+                    "Test reorganization/assertion rewrite is needed")
+    else:
+      # Default to False to ensure that the cluster is not restarted for every 
test.
+      kwargs[FORCE_RESTART] = False
 
     if args.get(EXPECT_CORES, False):
       # Make a note of any core files that already exist
@@ -535,7 +547,8 @@ class CustomClusterTestSuite(ImpalaTestSuite):
                             impalad_timeout_s=60,
                             ignore_pid_on_log_rotation=False,
                             wait_for_backends=True,
-                            log_symlinks=False):
+                            log_symlinks=False,
+                            force_restart=True):
     cls.impala_log_dir = impala_log_dir
     # We ignore TEST_START_CLUSTER_ARGS here. Custom cluster tests 
specifically test that
     # certain custom startup arguments work and we want to keep them 
independent of dev
@@ -575,8 +588,24 @@ class CustomClusterTestSuite(ImpalaTestSuite):
     options.append("--impalad_args=--default_query_options={0}".format(
         ','.join(["{0}={1}".format(k, v) for k, v in 
default_query_option_kvs])))
 
-    LOG.info("Starting cluster with command: %s" %
-        " ".join(pipes.quote(arg) for arg in cmd + options))
+    cmd_str = " ".join(pipes.quote(arg) for arg in cmd + options)
+
+    # If the cluster is already started, we don't need to start it again, 
unless
+    # force_restart is set to True. NOTE: reordering tests into classes with 
class-level
+    # 'with_args' decorators is a more preferable way to avoid restarting the 
cluster.
+    global PREVIOUS_CMD_STR
+    if PREVIOUS_CMD_STR == cmd_str and not force_restart:
+        LOG.info("Reusing existing cluster with command: %s" % cmd_str)
+        cls.cluster = ImpalaCluster.get_e2e_test_cluster()
+        try:
+          cls._verify_cluster(expected_num_impalads, options, 
wait_for_backends,
+                              expected_subscribers, 5, 5)
+          return
+        except Exception as e:
+          LOG.info("Failed to reuse running cluster: %s" % e)
+          pass
+
+    LOG.info("Starting cluster with command: %s" % cmd_str)
     try:
       check_call(cmd + options, close_fds=True)
     finally:
@@ -585,6 +614,19 @@ class CustomClusterTestSuite(ImpalaTestSuite):
 
       # Failure tests expect cluster to be initialised even if 
start-impala-cluster fails.
       cls.cluster = ImpalaCluster.get_e2e_test_cluster()
+
+    PREVIOUS_CMD_STR = cmd_str
+
+    cls._verify_cluster(expected_num_impalads, options, wait_for_backends,
+                        expected_subscribers, statestored_timeout_s, 
impalad_timeout_s)
+
+  @classmethod
+  def _verify_cluster(cls, expected_num_impalads, options, wait_for_backends,
+                   expected_subscribers, statestored_timeout_s, 
impalad_timeout_s):
+    """
+    Verifies the cluster by checking the number of live subscribers and 
backends.
+    Raises exception if verification fails.
+    """
     statestored = cls.cluster.statestored
     if statestored is None:
       raise Exception("statestored was not found")
diff --git a/tests/custom_cluster/test_admission_controller.py 
b/tests/custom_cluster/test_admission_controller.py
index aa20a5dda..92e6d5eaf 100644
--- a/tests/custom_cluster/test_admission_controller.py
+++ b/tests/custom_cluster/test_admission_controller.py
@@ -2808,7 +2808,7 @@ class 
TestAdmissionControllerStress(TestAdmissionControllerBase):
   @CustomClusterTestSuite.with_args(
       
impalad_args=impalad_admission_ctrl_flags(max_requests=MAX_NUM_CONCURRENT_QUERIES,
         max_queued=MAX_NUM_QUEUED_QUERIES, pool_max_mem=-1, 
queue_wait_timeout_ms=600000),
-      statestored_args=_STATESTORED_ARGS)
+      statestored_args=_STATESTORED_ARGS, force_restart=True)
   def test_admission_controller_with_flags(self, vector):
     if self.exploration_strategy() != 'exhaustive':
       pytest.skip('runs only in exhaustive')
@@ -2825,7 +2825,7 @@ class 
TestAdmissionControllerStress(TestAdmissionControllerBase):
     impalad_args=impalad_admission_ctrl_config_args(
       fs_allocation_file="fair-scheduler-test2.xml",
       llama_site_file="llama-site-test2.xml"),
-    statestored_args=_STATESTORED_ARGS)
+    statestored_args=_STATESTORED_ARGS, force_restart=True)
   def test_admission_controller_with_configs(self, vector):
     self.pool_name = 'root.queueB'
     vector.set_exec_option('request_pool', self.pool_name)
@@ -2836,7 +2836,7 @@ class 
TestAdmissionControllerStress(TestAdmissionControllerBase):
     impalad_args=impalad_admission_ctrl_config_args(
       fs_allocation_file="fair-scheduler-test2.xml",
       llama_site_file="llama-site-test2.xml"),
-    statestored_args=_STATESTORED_ARGS)
+    statestored_args=_STATESTORED_ARGS, force_restart=True)
   def test_admission_controller_with_quota_configs(self, vector):
     """Run a workload with a variety of outcomes in a pool that has user quotas
     configured. Note the user quotas will not prevent any queries from 
running, but this
@@ -2866,7 +2866,7 @@ class 
TestAdmissionControllerStress(TestAdmissionControllerBase):
         max_requests=MAX_NUM_CONCURRENT_QUERIES * 30, 
max_queued=MAX_NUM_QUEUED_QUERIES,
         pool_max_mem=MEM_TEST_LIMIT, proc_mem_limit=MEM_TEST_LIMIT,
         queue_wait_timeout_ms=600000),
-      statestored_args=_STATESTORED_ARGS)
+      statestored_args=_STATESTORED_ARGS, force_restart=True)
   def test_mem_limit(self, vector):
     # Impala may set the proc mem limit lower than we think depending on the 
overcommit
     # settings of the OS. It should be fine to continue anyway.
diff --git a/tests/custom_cluster/test_codegen_cache.py 
b/tests/custom_cluster/test_codegen_cache.py
index ba053a388..685957e52 100644
--- a/tests/custom_cluster/test_codegen_cache.py
+++ b/tests/custom_cluster/test_codegen_cache.py
@@ -39,7 +39,7 @@ class TestCodegenCache(CustomClusterTestSuite):
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(cluster_size=1,
-          impalad_args="--codegen_cache_capacity=1GB")
+          impalad_args="--codegen_cache_capacity=1GB", force_restart=True)
   def test_codegen_cache(self, vector):
     self._test_codegen_cache(vector,
             ("select * from (select * from functional.alltypes "
@@ -47,63 +47,63 @@ class TestCodegenCache(CustomClusterTestSuite):
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(cluster_size=1,
-          impalad_args="--codegen_cache_capacity=1GB")
+          impalad_args="--codegen_cache_capacity=1GB", force_restart=True)
   def test_codegen_cache_int_col(self, vector):
     self._test_codegen_cache(vector,
       "select * from functional.alltypes where int_col > 0")
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(cluster_size=1,
-          impalad_args="--codegen_cache_capacity=1GB")
+          impalad_args="--codegen_cache_capacity=1GB", force_restart=True)
   def test_codegen_cache_tinyint_col(self, vector):
     self._test_codegen_cache(vector,
       "select * from functional.alltypes where tinyint_col > 0")
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(cluster_size=1,
-          impalad_args="--codegen_cache_capacity=1GB")
+          impalad_args="--codegen_cache_capacity=1GB", force_restart=True)
   def test_codegen_cache_bool_col(self, vector):
     self._test_codegen_cache(vector,
       "select * from functional.alltypes where bool_col > 0")
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(cluster_size=1,
-          impalad_args="--codegen_cache_capacity=1GB")
+          impalad_args="--codegen_cache_capacity=1GB", force_restart=True)
   def test_codegen_cache_bigint_col(self, vector):
     self._test_codegen_cache(vector,
       "select * from functional.alltypes where bigint_col > 0")
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(cluster_size=1,
-          impalad_args="--codegen_cache_capacity=1GB")
+          impalad_args="--codegen_cache_capacity=1GB", force_restart=True)
   def test_codegen_cache_float_col(self, vector):
     self._test_codegen_cache(vector,
       "select * from functional.alltypes where float_col > 0")
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(cluster_size=1,
-          impalad_args="--codegen_cache_capacity=1GB")
+          impalad_args="--codegen_cache_capacity=1GB", force_restart=True)
   def test_codegen_cache_double_col(self, vector):
     self._test_codegen_cache(vector,
       "select * from functional.alltypes where double_col > 0")
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(cluster_size=1,
-          impalad_args="--codegen_cache_capacity=1GB")
+          impalad_args="--codegen_cache_capacity=1GB", force_restart=True)
   def test_codegen_cache_date_string_col(self, vector):
     self._test_codegen_cache(vector,
       "select * from functional.alltypes where date_string_col != ''")
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(cluster_size=1,
-          impalad_args="--codegen_cache_capacity=1GB")
+          impalad_args="--codegen_cache_capacity=1GB", force_restart=True)
   def test_codegen_cache_string_col(self, vector):
     self._test_codegen_cache(vector,
       "select * from functional.alltypes where string_col != ''")
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(cluster_size=1,
-          impalad_args="--codegen_cache_capacity=1GB")
+          impalad_args="--codegen_cache_capacity=1GB", force_restart=True)
   def test_codegen_cache_poly_func_string_col(self, vector):
     self._test_codegen_cache(vector,
       ("select * from functional.alltypes where "
@@ -111,7 +111,7 @@ class TestCodegenCache(CustomClusterTestSuite):
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(cluster_size=1,
-          impalad_args="--codegen_cache_capacity=1GB")
+          impalad_args="--codegen_cache_capacity=1GB", force_restart=True)
   def test_codegen_cache_poly_func_date_string_col(self, vector):
     self._test_codegen_cache(vector,
       ("select * from functional.alltypes where "
@@ -119,7 +119,7 @@ class TestCodegenCache(CustomClusterTestSuite):
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(cluster_size=1,
-          impalad_args="--codegen_cache_capacity=1GB")
+          impalad_args="--codegen_cache_capacity=1GB", force_restart=True)
   # Test native uda is missed in the codegen cache, as it is disabled.
   def test_codegen_cache_uda_miss(self, vector):
     database = "test_codegen_cache_uda_miss"
@@ -129,7 +129,7 @@ class TestCodegenCache(CustomClusterTestSuite):
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(cluster_size=1,
-          impalad_args="--codegen_cache_capacity=1GB")
+          impalad_args="--codegen_cache_capacity=1GB", force_restart=True)
   # Test native udf is missed in the codegen cache, as it is disabled.
   def test_codegen_cache_udf_miss(self, vector):
     database = "test_codegen_cache_udf_miss"
diff --git a/tests/custom_cluster/test_kill_query.py 
b/tests/custom_cluster/test_kill_query.py
index c194be0d5..00ce67293 100644
--- a/tests/custom_cluster/test_kill_query.py
+++ b/tests/custom_cluster/test_kill_query.py
@@ -53,6 +53,7 @@ class TestKillQuery(CustomClusterTestSuite):
       )
 
   @pytest.mark.execute_serially
+  @CustomClusterTestSuite.with_args(force_restart=True)
   def test_another_coordinator_unreachable(self):
     """
     A coordinator other than the one of the query to kill is unreachable.
diff --git a/tests/custom_cluster/test_krpc_metrics.py 
b/tests/custom_cluster/test_krpc_metrics.py
index 7b4ec4ae3..6593b27cd 100644
--- a/tests/custom_cluster/test_krpc_metrics.py
+++ b/tests/custom_cluster/test_krpc_metrics.py
@@ -58,7 +58,8 @@ class TestKrpcMetrics(CustomClusterTestSuite):
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args('-datastream_service_queue_mem_limit=1B \
-                                     -datastream_service_num_svc_threads=1')
+                                     -datastream_service_num_svc_threads=1',
+                                     force_restart=True)
   def test_krpc_queue_overflow_metrics(self, vector):
     """Test that rejected RPCs show up on the /metrics debug web page.
     """
diff --git a/tests/custom_cluster/test_kudu.py 
b/tests/custom_cluster/test_kudu.py
index 296a05ffd..d87534b03 100644
--- a/tests/custom_cluster/test_kudu.py
+++ b/tests/custom_cluster/test_kudu.py
@@ -612,40 +612,47 @@ class TestKuduTransaction(TestKuduTransactionBase):
 
   @pytest.mark.execute_serially
   @SkipIfKudu.no_hybrid_clock()
+  @CustomClusterTestSuite.with_args(force_restart=True)
   def test_kudu_txn_succeed(self, unique_database):
     self._test_kudu_txn_succeed(unique_database)
 
   @pytest.mark.execute_serially
   @SkipIfKudu.no_hybrid_clock()
+  @CustomClusterTestSuite.with_args(force_restart=True)
   def test_kudu_txn_not_implemented(self, unique_database):
     self._test_kudu_txn_not_implemented(unique_database)
 
   @pytest.mark.execute_serially
   @SkipIfKudu.no_hybrid_clock()
+  @CustomClusterTestSuite.with_args(force_restart=True)
   def test_kudu_txn_abort_dup_key(self, unique_database):
     self._test_kudu_txn_abort_dup_key(unique_database, True,
         self._duplicate_key_error)
 
   @pytest.mark.execute_serially
   @SkipIfKudu.no_hybrid_clock()
+  @CustomClusterTestSuite.with_args(force_restart=True)
   def test_kudu_txn_ctas(self, unique_database):
     self._test_kudu_txn_ctas(unique_database, True, self._duplicate_key_error)
 
   @pytest.mark.execute_serially
   @SkipIfKudu.no_hybrid_clock()
   @SkipIfBuildType.not_dev_build
+  @CustomClusterTestSuite.with_args(force_restart=True)
   def test_kudu_txn_abort_row_batch(self, unique_database):
     self._test_kudu_txn_abort_row_batch(unique_database)
 
   @pytest.mark.execute_serially
   @SkipIfKudu.no_hybrid_clock()
   @SkipIfBuildType.not_dev_build
+  @CustomClusterTestSuite.with_args(force_restart=True)
   def test_kudu_txn_abort_partial_rows(self, unique_database):
     self._test_kudu_txn_abort_partial_rows(unique_database)
 
   @pytest.mark.execute_serially
   @SkipIfKudu.no_hybrid_clock()
   @SkipIfBuildType.not_dev_build
+  @CustomClusterTestSuite.with_args(force_restart=True)
   def test_kudu_txn_abort_partition_lock(self, unique_database):
     self._test_kudu_txn_abort_partition_lock(unique_database)
 
diff --git a/tests/custom_cluster/test_local_catalog.py 
b/tests/custom_cluster/test_local_catalog.py
index c4e92e9ba..fae07b4f7 100644
--- a/tests/custom_cluster/test_local_catalog.py
+++ b/tests/custom_cluster/test_local_catalog.py
@@ -579,7 +579,8 @@ class TestLocalCatalogObservability(CustomClusterTestSuite):
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(
       impalad_args="--use_local_catalog=true",
-      catalogd_args="--catalog_topic_mode=minimal")
+      catalogd_args="--catalog_topic_mode=minimal",
+      force_restart=True)
   def test_lightweight_rpc_metrics(self):
     """Verify catalogd client cache for lightweight RPCs is used correctly"""
     # Fetching the db and table list should be lightweight requests
diff --git a/tests/custom_cluster/test_query_log.py 
b/tests/custom_cluster/test_query_log.py
index f1e7a7bd8..44a3454db 100644
--- a/tests/custom_cluster/test_query_log.py
+++ b/tests/custom_cluster/test_query_log.py
@@ -279,7 +279,8 @@ class TestQueryLogTableBasic(WorkloadManagementTestSuite):
   @CustomClusterTestSuite.with_args(cluster_size=3,
                                     num_exclusive_coordinators=2,
                                     workload_mgmt=True,
-                                    disable_log_buffering=True)
+                                    disable_log_buffering=True,
+                                    force_restart=True)
   def test_dedicated_coordinator_with_mt_dop(self, vector):
     """Asserts the values written to the query log table match the values from 
the
        query profile when dedicated coordinators are used along with an MT_DOP 
setting
@@ -671,7 +672,8 @@ class TestQueryLogTableAll(WorkloadManagementTestSuite):
 
   
@CustomClusterTestSuite.with_args(impalad_args="--cluster_id=test_query_hist_2",
                                     workload_mgmt=True,
-                                    disable_log_buffering=True)
+                                    disable_log_buffering=True,
+                                    force_restart=True)
   def test_invalid_query(self, vector):
     """Asserts correct values are written to the completed queries table for a 
failed
        query. The query profile is used as the source of expected values."""
@@ -792,7 +794,8 @@ class TestQueryLogTableAll(WorkloadManagementTestSuite):
         "impala-server.completed-queries.failure") == 0
 
   @CustomClusterTestSuite.with_args(workload_mgmt=True,
-                                    disable_log_buffering=True)
+                                    disable_log_buffering=True,
+                                    force_restart=True)
   def test_sql_injection_attempts(self, vector):
     client = self.get_client(vector.get_value('protocol'))
     impalad = self.cluster.get_first_impalad()
diff --git a/tests/custom_cluster/test_query_retries.py 
b/tests/custom_cluster/test_query_retries.py
index b372ea574..a1789ed52 100644
--- a/tests/custom_cluster/test_query_retries.py
+++ b/tests/custom_cluster/test_query_retries.py
@@ -202,7 +202,7 @@ class TestQueryRetries(CustomClusterTestSuite):
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(
-      statestored_args="-statestore_heartbeat_frequency_ms=1000")
+      statestored_args="-statestore_heartbeat_frequency_ms=1000", 
force_restart=True)
   def test_kill_impalad_expect_retries(self):
     """Similar to 'test_kill_impalad_expect_retry' except it runs multiple 
queries in
     parallel and then kills an impalad. Several of the code comments in
@@ -526,6 +526,7 @@ class TestQueryRetries(CustomClusterTestSuite):
              "fetched some rows" % self.client.handle_id(handle) in str(e)
 
   @pytest.mark.execute_serially
+  @CustomClusterTestSuite.with_args(force_restart=True)
   def test_spooling_all_results_for_retries(self):
     """Test retryable queries with spool_all_results_for_retries=true will 
spool all
     results when results spooling is enabled."""
@@ -558,6 +559,7 @@ class TestQueryRetries(CustomClusterTestSuite):
     self.client.close_query(handle)
 
   @pytest.mark.execute_serially
+  @CustomClusterTestSuite.with_args(force_restart=True)
   def test_query_retry_in_spooling(self):
     """Test retryable queries with results spooling enabled and
     spool_all_results_for_retries=true can be safely retried for failures that 
happen when
@@ -583,6 +585,7 @@ class TestQueryRetries(CustomClusterTestSuite):
     self.client.close_query(handle)
 
   @pytest.mark.execute_serially
+  @CustomClusterTestSuite.with_args(force_restart=True)
   def test_retried_query_not_spooling_all_results(self):
     """Test retried query can return results immediately even when results 
spooling and
     spool_all_results_for_retries are enabled in the original query."""
diff --git a/tests/custom_cluster/test_restart_services.py 
b/tests/custom_cluster/test_restart_services.py
index f2b3e7a48..1ae35ce56 100644
--- a/tests/custom_cluster/test_restart_services.py
+++ b/tests/custom_cluster/test_restart_services.py
@@ -969,7 +969,8 @@ class TestGracefulShutdown(CustomClusterTestSuite, 
HS2TestSuite):
           deadline=COORD_SHUTDOWN_FAST_DEADLINE_S,
           query_cancel_period=COORD_SHUTDOWN_QUERY_CANCEL_PERIOD_S,
           hostname=socket.gethostname()),
-      default_query_options=[("num_scanner_threads", "1")])
+      default_query_options=[("num_scanner_threads", "1")],
+      force_restart=True)
   def test_shutdown_coordinator_and_executor_cancel_query(self):
     """Test that shuts down the executor and coordinator, the slow query should
     be cancelled before the deadline is reached."""
diff --git a/tests/custom_cluster/test_shell_interactive.py 
b/tests/custom_cluster/test_shell_interactive.py
index b14bcd65a..7d9d45896 100644
--- a/tests/custom_cluster/test_shell_interactive.py
+++ b/tests/custom_cluster/test_shell_interactive.py
@@ -124,6 +124,7 @@ class TestShellInteractive(CustomClusterTestSuite):
     proc.expect("00:SCAN HDFS\w*| 3\w*| 3")
 
   @pytest.mark.execute_serially
+  @CustomClusterTestSuite.with_args(force_restart=True)
   def test_query_retries_show_profiles(self):
     """Tests transparent query retries via impala-shell. Validates that the 
output of the
     impala-shell when the '-p' option is specified prints out both the 
original and
diff --git a/tests/custom_cluster/test_shell_interactive_reconnect.py 
b/tests/custom_cluster/test_shell_interactive_reconnect.py
index dff261eee..7bf391b40 100644
--- a/tests/custom_cluster/test_shell_interactive_reconnect.py
+++ b/tests/custom_cluster/test_shell_interactive_reconnect.py
@@ -35,6 +35,7 @@ NUM_QUERIES = 'impala-server.num-queries'
 class TestShellInteractiveReconnect(CustomClusterTestSuite):
   """ Check if interactive shell is using the current DB after reconnecting """
   @pytest.mark.execute_serially
+  @CustomClusterTestSuite.with_args(force_restart=True)
   def test_manual_reconnect(self):
     # Iterate over test vector within test function to avoid restarting 
cluster.
     for vector in\
@@ -50,6 +51,7 @@ class TestShellInteractiveReconnect(CustomClusterTestSuite):
       assert "alltypesaggmultifilesnopart" in result.stdout, result.stdout
 
   @pytest.mark.execute_serially
+  @CustomClusterTestSuite.with_args(force_restart=True)
   def test_auto_reconnect(self):
     impalad = ImpaladService(socket.getfqdn())
 

Reply via email to