From b8d2db299f9724b342b1800019e9a81455513fcd Mon Sep 17 00:00:00 2001 From: Xun Date: Wed, 11 Dec 2024 15:04:19 +0800 Subject: [PATCH] 1 --- .../tests/integration/auth/test_oauth2_client.py | 4 ++-- .../client-python/tests/integration/integration_test_env.py | 6 +----- .../client-python/tests/integration/test_gvfs_with_abs.py | 4 ++-- .../client-python/tests/integration/test_gvfs_with_gcs.py | 4 ++-- .../client-python/tests/integration/test_gvfs_with_hdfs.py | 4 ++-- .../client-python/tests/integration/test_gvfs_with_oss.py | 4 ++-- .../client-python/tests/integration/test_gvfs_with_s3.py | 4 ++-- 7 files changed, 13 insertions(+), 17 deletions(-) diff --git a/clients/client-python/tests/integration/auth/test_oauth2_client.py b/clients/client-python/tests/integration/auth/test_oauth2_client.py index 4e6601c2a04..733e6d6f19e 100644 --- a/clients/client-python/tests/integration/auth/test_oauth2_client.py +++ b/clients/client-python/tests/integration/auth/test_oauth2_client.py @@ -74,7 +74,7 @@ def setUpClass(cls): # append the hadoop conf to server cls._append_conf(cls.config, cls.oauth2_conf_path) - IntegrationTestEnv.restart_server() + IntegrationTestEnv.exec_gravitino("restart") cls.oauth2_token_provider = DefaultOAuth2TokenProvider( f"{cls.oauth2_server_uri}", "test:test", "test", "oauth2/token" ) @@ -95,7 +95,7 @@ def tearDownClass(cls): # reset server conf cls._reset_conf(cls.config, cls.oauth2_conf_path) # restart server - cls.restart_server() + cls.exec_gravitino("restart") finally: # close oauth2 container cls.oauth2_container.close() diff --git a/clients/client-python/tests/integration/integration_test_env.py b/clients/client-python/tests/integration/integration_test_env.py index a32817699ca..e2ba5ed9812 100644 --- a/clients/client-python/tests/integration/integration_test_env.py +++ b/clients/client-python/tests/integration/integration_test_env.py @@ -117,6 +117,7 @@ def exec_gravitino(cls, *args): logger.info("stdout: %s", result.stdout) if result.stderr: logger.info("stderr: %s", result.stderr) + check_gravitino_server_status() @classmethod def tearDownClass(cls): @@ -140,11 +141,6 @@ def tearDownClass(cls): if gravitino_server_running: logger.error("Can't stop Gravitino server!") - @classmethod - def restart_server(cls): - logger.info("Restarting Gravitino server...") - cls.exec_gravitino("restart") - @classmethod def _get_gravitino_home(cls): gravitino_home = os.environ.get("GRAVITINO_HOME") diff --git a/clients/client-python/tests/integration/test_gvfs_with_abs.py b/clients/client-python/tests/integration/test_gvfs_with_abs.py index 5e574391a9d..83a09ae1270 100644 --- a/clients/client-python/tests/integration/test_gvfs_with_abs.py +++ b/clients/client-python/tests/integration/test_gvfs_with_abs.py @@ -71,7 +71,7 @@ def setUpClass(cls): cls.hadoop_conf_path = f"{cls.gravitino_home}/catalogs/hadoop/conf/hadoop.conf" # restart the server - cls.restart_server() + cls.exec_gravitino("restart") # create entity cls._init_test_entities() @@ -82,7 +82,7 @@ def tearDownClass(cls): # to reset it cls._reset_conf(cls.config, cls.hadoop_conf_path) # restart server - cls.restart_server() + cls.exec_gravitino("restart") # clear all config in the conf_path @classmethod diff --git a/clients/client-python/tests/integration/test_gvfs_with_gcs.py b/clients/client-python/tests/integration/test_gvfs_with_gcs.py index be04b967bf3..7cfa322c0a6 100644 --- a/clients/client-python/tests/integration/test_gvfs_with_gcs.py +++ b/clients/client-python/tests/integration/test_gvfs_with_gcs.py @@ -66,7 +66,7 @@ def setUpClass(cls): cls.hadoop_conf_path = f"{cls.gravitino_home}/catalogs/hadoop/conf/hadoop.conf" # restart the server - cls.restart_server() + cls.exec_gravitino("restart") # create entity cls._init_test_entities() @@ -77,7 +77,7 @@ def tearDownClass(cls): # to reset it cls._reset_conf(cls.config, cls.hadoop_conf_path) # restart server - cls.restart_server() + cls.exec_gravitino("restart") # clear all config in the conf_path @classmethod diff --git a/clients/client-python/tests/integration/test_gvfs_with_hdfs.py b/clients/client-python/tests/integration/test_gvfs_with_hdfs.py index 6a14bef1594..c7da7d13c73 100644 --- a/clients/client-python/tests/integration/test_gvfs_with_hdfs.py +++ b/clients/client-python/tests/integration/test_gvfs_with_hdfs.py @@ -105,7 +105,7 @@ def setUpClass(cls): # append the hadoop conf to server cls._append_conf(cls.config, cls.hadoop_conf_path) # restart the server - cls.restart_server() + cls.exec_gravitino("restart") cls.gravitino_admin_client = GravitinoAdminClient(uri="http://localhost:8090") # create entity cls._init_test_entities() @@ -117,7 +117,7 @@ def tearDownClass(cls): # reset server conf cls._reset_conf(cls.config, cls.hadoop_conf_path) # restart server - cls.restart_server() + cls.exec_gravitino("restart") # clear hadoop env BaseHadoopEnvironment.clear_hadoop_env() finally: diff --git a/clients/client-python/tests/integration/test_gvfs_with_oss.py b/clients/client-python/tests/integration/test_gvfs_with_oss.py index d60952ecbba..f029945e5ca 100644 --- a/clients/client-python/tests/integration/test_gvfs_with_oss.py +++ b/clients/client-python/tests/integration/test_gvfs_with_oss.py @@ -74,7 +74,7 @@ def setUpClass(cls): cls.hadoop_conf_path = f"{cls.gravitino_home}/catalogs/hadoop/conf/hadoop.conf" # restart the server - cls.restart_server() + cls.exec_gravitino("restart") # create entity cls._init_test_entities() @@ -85,7 +85,7 @@ def tearDownClass(cls): # to reset it cls._reset_conf(cls.config, cls.hadoop_conf_path) # restart server - cls.restart_server() + cls.exec_gravitino("restart") # clear all config in the conf_path @classmethod diff --git a/clients/client-python/tests/integration/test_gvfs_with_s3.py b/clients/client-python/tests/integration/test_gvfs_with_s3.py index 5fc8e02121e..f6e82292f51 100644 --- a/clients/client-python/tests/integration/test_gvfs_with_s3.py +++ b/clients/client-python/tests/integration/test_gvfs_with_s3.py @@ -73,7 +73,7 @@ def setUpClass(cls): cls.hadoop_conf_path = f"{cls.gravitino_home}/catalogs/hadoop/conf/hadoop.conf" # restart the server - cls.restart_server() + cls.exec_gravitino("restart") # create entity cls._init_test_entities() @@ -84,7 +84,7 @@ def tearDownClass(cls): # to reset it cls._reset_conf(cls.config, cls.hadoop_conf_path) # restart server - cls.restart_server() + cls.exec_gravitino("restart") # clear all config in the conf_path @classmethod