mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 09:38:39 +08:00
[skip e2e] Fix index timeout after scale out (#15185)
Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
This commit is contained in:
parent
008e08a996
commit
50695e5b8b
@ -38,9 +38,10 @@ class CustomResourceOperations(object):
|
||||
try:
|
||||
config.load_kube_config()
|
||||
api_instance = client.CustomObjectsApi()
|
||||
data = api_instance.delete_namespaced_custom_object(self.group, self.version, self.namespace, self.plural,
|
||||
api_response = api_instance.delete_namespaced_custom_object(self.group, self.version, self.namespace,
|
||||
self.plural,
|
||||
metadata_name)
|
||||
log.debug(f"delete custom resource response: {data}")
|
||||
log.debug(f"delete custom resource response: {api_response}")
|
||||
except ApiException as e:
|
||||
if raise_ex:
|
||||
log.error("Exception when calling CustomObjectsApi->delete_namespaced_custom_object: %s\n" % e)
|
||||
@ -67,13 +68,13 @@ class CustomResourceOperations(object):
|
||||
try:
|
||||
config.load_kube_config()
|
||||
api_instance = client.CustomObjectsApi()
|
||||
data = api_instance.list_namespaced_custom_object(self.group, self.version, self.namespace,
|
||||
api_response = api_instance.list_namespaced_custom_object(self.group, self.version, self.namespace,
|
||||
plural=self.plural, pretty=pretty)
|
||||
log.debug(f"list custom resource response: {data}")
|
||||
log.debug(f"list custom resource response: {api_response}")
|
||||
except ApiException as e:
|
||||
log.error("Exception when calling CustomObjectsApi->list_namespaced_custom_object: %s\n" % e)
|
||||
raise Exception(str(e))
|
||||
return data
|
||||
return api_response
|
||||
|
||||
def get(self, metadata_name):
|
||||
"""get a customer resources by name in k8s"""
|
||||
|
||||
@ -125,6 +125,7 @@ class TestIndexNodeScale:
|
||||
log.info(f"milvus healthy: {healthy}")
|
||||
host = mic.endpoint(release_name, constants.NAMESPACE).split(':')[0]
|
||||
|
||||
try:
|
||||
# connect
|
||||
connections.add_connection(default={"host": host, "port": 19530})
|
||||
connections.connect(alias='default')
|
||||
@ -155,6 +156,8 @@ class TestIndexNodeScale:
|
||||
|
||||
# expand indexNode from 2 to 1
|
||||
mic.upgrade(release_name, {'spec.components.indexNode.replicas': 1}, constants.NAMESPACE)
|
||||
time.sleep(5)
|
||||
mic.wait_for_healthy(release_name, constants.NAMESPACE)
|
||||
|
||||
start = datetime.datetime.now()
|
||||
collection_w.create_index(ct.default_float_vec_field_name, default_index_params)
|
||||
@ -165,4 +168,8 @@ class TestIndexNodeScale:
|
||||
log.debug(t1 / t0)
|
||||
assert round(t1 / t0) == 2
|
||||
|
||||
except Exception as e:
|
||||
raise Exception(str(e))
|
||||
|
||||
finally:
|
||||
mic.uninstall(release_name, namespace=constants.NAMESPACE)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user