diff --git a/tests/python_client/chaos/checker.py b/tests/python_client/chaos/checker.py index 85c27232ff..340e52ca1e 100644 --- a/tests/python_client/chaos/checker.py +++ b/tests/python_client/chaos/checker.py @@ -144,6 +144,12 @@ class SearchChecker(Checker): if collection_name is None: collection_name = cf.gen_unique_str("SearchChecker_") super().__init__(collection_name=collection_name, shards_num=shards_num) + self.c_wrap.create_index(ct.default_float_vec_field_name, + constants.DEFAULT_INDEX_PARAM, + name=cf.gen_unique_str('index_'), + timeout=timeout, + enable_traceback=enable_traceback, + check_task=CheckTasks.check_nothing) # do load before search self.c_wrap.load(replica_number=replica_number) @@ -152,7 +158,7 @@ class SearchChecker(Checker): res, result = self.c_wrap.search( data=cf.gen_vectors(5, ct.default_dim), anns_field=ct.default_float_vec_field_name, - param={"nprobe": 32}, + param=constants.DEFAULT_SEARCH_PARAM, limit=1, timeout=timeout, check_task=CheckTasks.check_nothing diff --git a/tests/python_client/chaos/constants.py b/tests/python_client/chaos/constants.py index 778f0b20ae..11322d08b8 100644 --- a/tests/python_client/chaos/constants.py +++ b/tests/python_client/chaos/constants.py @@ -21,4 +21,5 @@ ALL_CHAOS_YAMLS = 'chaos_allstandalone_pod_kill.yaml' RELEASE_NAME = 'test-allstandalone-pod-kill-19-25-26' WAIT_PER_OP = 10 # time to wait in seconds between operations CHAOS_DURATION = 120 # chaos duration time in seconds -DEFAULT_INDEX_PARAM = {"index_type": "IVF_SQ8", "metric_type": "L2", "params": {"nlist": 64}} +DEFAULT_INDEX_PARAM = {"index_type": "HNSW", "metric_type": "L2", "params": {"M": 48, "efConstruction": 500}} +DEFAULT_SEARCH_PARAM = {"metric_type": "L2", "params": {"ef": 64}} \ No newline at end of file diff --git a/tests/python_client/chaos/testcases/test_all_collections_after_chaos.py b/tests/python_client/chaos/testcases/test_all_collections_after_chaos.py index f6e39adb40..d3e115d5ae 100644 --- a/tests/python_client/chaos/testcases/test_all_collections_after_chaos.py +++ b/tests/python_client/chaos/testcases/test_all_collections_after_chaos.py @@ -54,7 +54,7 @@ class TestAllCollection(TestcaseBase): # search collection_w.load() search_vectors = cf.gen_vectors(1, ct.default_dim) - search_params = {"metric_type": "L2", "params": {"nprobe": 16}} + search_params = {"metric_type": "L2", "params": {"ef": 64}} t0 = time.time() res_1, _ = collection_w.search(data=search_vectors, anns_field=ct.default_float_vec_field_name, @@ -68,7 +68,7 @@ class TestAllCollection(TestcaseBase): d = cf.gen_default_list_data() collection_w.insert(d) log.info(f"assert index entities: {collection_w.num_entities}") - _index_params = {"index_type": "IVF_SQ8", "params": {"nlist": 64}, "metric_type": "L2"} + _index_params = {"index_type": "HNSW", "metric_type": "L2", "params": {"M": 48, "efConstruction": 500}} t0 = time.time() index, _ = collection_w.create_index(field_name=ct.default_float_vec_field_name, index_params=_index_params, diff --git a/tests/python_client/chaos/testcases/test_concurrent_operation.py b/tests/python_client/chaos/testcases/test_concurrent_operation.py index ca2e09cc62..f4fb583f72 100644 --- a/tests/python_client/chaos/testcases/test_concurrent_operation.py +++ b/tests/python_client/chaos/testcases/test_concurrent_operation.py @@ -84,7 +84,7 @@ class TestOperations(TestBase): checkers = { Op.insert: InsertChecker(collection_name=c_name), Op.flush: FlushChecker(collection_name=c_name), - Op.index: IndexChecker(collection_name=c_name), + # Op.index: IndexChecker(collection_name=c_name), Op.search: SearchChecker(collection_name=c_name), Op.query: QueryChecker(collection_name=c_name), Op.delete: DeleteChecker(collection_name=c_name), diff --git a/tests/python_client/chaos/testcases/test_data_persistence.py b/tests/python_client/chaos/testcases/test_data_persistence.py index 97d7fc396f..3e0926892e 100644 --- a/tests/python_client/chaos/testcases/test_data_persistence.py +++ b/tests/python_client/chaos/testcases/test_data_persistence.py @@ -47,7 +47,7 @@ class TestDataPersistence(TestcaseBase): # search collection_w.load() search_vectors = cf.gen_vectors(1, ct.default_dim) - search_params = {"metric_type": "L2", "params": {"nprobe": 16}} + search_params = {"metric_type": "L2", "params": {"ef": 64}} t0 = time.time() res_1, _ = collection_w.search(data=search_vectors, anns_field=ct.default_float_vec_field_name, @@ -61,7 +61,7 @@ class TestDataPersistence(TestcaseBase): d = cf.gen_default_list_data() collection_w.insert(d) log.info(f"assert index entities: {collection_w.num_entities}") - _index_params = {"index_type": "IVF_SQ8", "params": {"nlist": 64}, "metric_type": "L2"} + _index_params = {"index_type": "HNSW", "metric_type": "L2", "params": {"M": 48, "efConstruction": 500}} t0 = time.time() index, _ = collection_w.create_index(field_name=ct.default_float_vec_field_name, index_params=_index_params, diff --git a/tests/python_client/deploy/scripts/utils.py b/tests/python_client/deploy/scripts/utils.py index 20da6a2259..774fe514dc 100644 --- a/tests/python_client/deploy/scripts/utils.py +++ b/tests/python_client/deploy/scripts/utils.py @@ -8,7 +8,7 @@ from pymilvus import ( all_index_types = ["FLAT", "IVF_FLAT", "IVF_SQ8", "IVF_PQ", "HNSW", "ANNOY"] default_index_params = [{"nlist": 128}, {"nlist": 128}, {"nlist": 128}, {"nlist": 128, "m": 16, "nbits": 8}, - {"M": 48, "efConstruction": 500}, {"n_trees": 50}, {"nlist": 128}, {"nlist": 128}] + {"M": 48, "efConstruction": 500}, {"n_trees": 50}] index_params_map = dict(zip(all_index_types, default_index_params))