[test]modify the diskann testcase (#20728)

Signed-off-by: jingkl <jingjing.jia@zilliz.com>

Signed-off-by: jingkl <jingjing.jia@zilliz.com>
pull/20785/head
jingkl 2022-11-23 09:53:21 +08:00 committed by GitHub
parent 89bdb34c98
commit 2966710b9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 27 deletions

View File

@ -14,7 +14,7 @@ class ApiIndexWrapper:
def init_index(self, collection, field_name, index_params, index_name=None, check_task=None, check_items=None, def init_index(self, collection, field_name, index_params, index_name=None, check_task=None, check_items=None,
**kwargs): **kwargs):
disktimeout = 100 disktimeout = 300
timeout = kwargs.get("timeout", disktimeout * 2) timeout = kwargs.get("timeout", disktimeout * 2)
index_name = INDEX_NAME if index_name is None else index_name index_name = INDEX_NAME if index_name is None else index_name
index_name = kwargs.get("index_name", index_name) index_name = kwargs.get("index_name", index_name)

View File

@ -70,6 +70,7 @@ class TestCompactionParams(TestcaseBase):
log.debug(c_plans2.plans[0].target) log.debug(c_plans2.plans[0].target)
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L1)
@pytest.mark.skip(reason="https://github.com/milvus-io/milvus/issues/20747")
def test_compact_partition(self): def test_compact_partition(self):
""" """
target: test compact partition target: test compact partition

View File

@ -1580,11 +1580,11 @@ class TestIndexDiskann(TestcaseBase):
collection_w = self.init_collection_wrap(name=c_name) collection_w = self.init_collection_wrap(name=c_name)
data = cf.gen_default_list_data() data = cf.gen_default_list_data()
collection_w.insert(data=data) collection_w.insert(data=data)
assert collection_w.num_entities == default_nb
index, _ = self.index_wrap.init_index(collection_w.collection, default_float_vec_field_name, ct.default_diskann_index) index, _ = self.index_wrap.init_index(collection_w.collection, default_float_vec_field_name, ct.default_diskann_index)
log.info(self.index_wrap.params) log.info(self.index_wrap.params)
cf.assert_equal_index(index, collection_w.indexes[0]) cf.assert_equal_index(index, collection_w.indexes[0])
collection_w.load() collection_w.load()
assert collection_w.num_entities == default_nb
vectors = [[random.random() for _ in range(default_dim)] for _ in range(default_nq)] vectors = [[random.random() for _ in range(default_dim)] for _ in range(default_nq)]
search_res, _ = collection_w.search(vectors[:default_nq], default_search_field, search_res, _ = collection_w.search(vectors[:default_nq], default_search_field,
ct.default_diskann_search_params, default_limit, ct.default_diskann_search_params, default_limit,
@ -1625,6 +1625,7 @@ class TestIndexDiskann(TestcaseBase):
collection_w = self.init_collection_wrap(c_name) collection_w = self.init_collection_wrap(c_name)
data = cf.gen_default_list_data() data = cf.gen_default_list_data()
collection_w.insert(data=data) collection_w.insert(data=data)
assert collection_w.num_entities == default_nb
res, _ = collection_w.create_index(ct.default_float_vec_field_name, ct.default_diskann_index, res, _ = collection_w.create_index(ct.default_float_vec_field_name, ct.default_diskann_index,
index_name=ct.default_index_name, _async=_async, index_name=ct.default_index_name, _async=_async,
_callback=self.call_back()) _callback=self.call_back())
@ -1651,6 +1652,7 @@ class TestIndexDiskann(TestcaseBase):
collection_w = self.init_collection_wrap(c_name) collection_w = self.init_collection_wrap(c_name)
data = cf.gen_default_list_data() data = cf.gen_default_list_data()
collection_w.insert(data=data) collection_w.insert(data=data)
assert collection_w.num_entities == default_nb
res, _ = collection_w.create_index(ct.default_float_vec_field_name, ct.default_diskann_index, res, _ = collection_w.create_index(ct.default_float_vec_field_name, ct.default_diskann_index,
index_name=ct.default_index_name, _async=_async) index_name=ct.default_index_name, _async=_async)
if _async: if _async:
@ -1699,6 +1701,7 @@ class TestIndexDiskann(TestcaseBase):
collection_w = self.init_collection_wrap(name=c_name) collection_w = self.init_collection_wrap(name=c_name)
data = cf.gen_default_list_data() data = cf.gen_default_list_data()
collection_w.insert(data=data) collection_w.insert(data=data)
assert collection_w.num_entities == default_nb
collection_w.create_index(default_float_vec_field_name, ct.default_diskann_index, index_name=index_name1) collection_w.create_index(default_float_vec_field_name, ct.default_diskann_index, index_name=index_name1)
collection_w.load() collection_w.load()
assert len(collection_w.indexes) == 1 assert len(collection_w.indexes) == 1
@ -1718,6 +1721,7 @@ class TestIndexDiskann(TestcaseBase):
collection_w = self.init_collection_wrap(name=c_name) collection_w = self.init_collection_wrap(name=c_name)
data = cf.gen_default_list_data() data = cf.gen_default_list_data()
collection_w.insert(data=data) collection_w.insert(data=data)
assert collection_w.num_entities == default_nb
collection_w.create_index(default_field_name, ct.default_diskann_index) collection_w.create_index(default_field_name, ct.default_diskann_index)
collection_w.load() collection_w.load()
assert len(collection_w.indexes) == 1 assert len(collection_w.indexes) == 1
@ -1739,6 +1743,7 @@ class TestIndexDiskann(TestcaseBase):
collection_w = self.init_collection_wrap(name=c_name) collection_w = self.init_collection_wrap(name=c_name)
data = cf.gen_default_list_data() data = cf.gen_default_list_data()
collection_w.insert(data=data) collection_w.insert(data=data)
assert collection_w.num_entities == default_nb
collection_w.create_index(default_float_vec_field_name, ct.default_diskann_index, index_name="a") collection_w.create_index(default_float_vec_field_name, ct.default_diskann_index, index_name="a")
assert collection_w.has_index(index_name="a")[0] == True assert collection_w.has_index(index_name="a")[0] == True
collection_w.create_index(default_string_field_name, default_string_index_params, index_name="b") collection_w.create_index(default_string_field_name, default_string_index_params, index_name="b")
@ -1762,6 +1767,7 @@ class TestIndexDiskann(TestcaseBase):
assert collection_w.has_partition(partition_name)[0] assert collection_w.has_partition(partition_name)[0]
df = cf.gen_default_list_data() df = cf.gen_default_list_data()
ins_res, _ = partition_w.insert(df) ins_res, _ = partition_w.insert(df)
assert collection_w.num_entities == default_nb
collection_w.create_index(default_float_vec_field_name, ct.default_diskann_index) collection_w.create_index(default_float_vec_field_name, ct.default_diskann_index)
collection_w.load() collection_w.load()
assert len(collection_w.indexes) == 1 assert len(collection_w.indexes) == 1
@ -1797,6 +1803,7 @@ class TestIndexDiskann(TestcaseBase):
collection_w = self.init_collection_wrap(name=c_name) collection_w = self.init_collection_wrap(name=c_name)
data = cf.gen_default_list_data(default_nb) data = cf.gen_default_list_data(default_nb)
collection_w.insert(data=data) collection_w.insert(data=data)
assert collection_w.num_entities == default_nb
def build(collection_w): def build(collection_w):

View File

@ -300,8 +300,8 @@ class TestCollectionSearchInvalid(TestcaseBase):
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L1)
@pytest.mark.parametrize("index, params", @pytest.mark.parametrize("index, params",
zip(ct.all_index_types[:6], zip(ct.all_index_types[:7],
ct.default_index_params[:6])) ct.default_index_params[:7]))
def test_search_invalid_params_type(self, index, params): def test_search_invalid_params_type(self, index, params):
""" """
target: test search with invalid search params target: test search with invalid search params
@ -1476,8 +1476,8 @@ class TestCollectionSearch(TestcaseBase):
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L1)
@pytest.mark.parametrize("index, params", @pytest.mark.parametrize("index, params",
zip(ct.all_index_types[:6], zip(ct.all_index_types[:7],
ct.default_index_params[:6])) ct.default_index_params[:7]))
def test_search_after_different_index_with_params(self, dim, index, params, auto_id, _async): def test_search_after_different_index_with_params(self, dim, index, params, auto_id, _async):
""" """
target: test search after different index target: test search after different index
@ -1554,8 +1554,8 @@ class TestCollectionSearch(TestcaseBase):
@pytest.mark.tags(CaseLabel.L2) @pytest.mark.tags(CaseLabel.L2)
@pytest.mark.parametrize("index, params", @pytest.mark.parametrize("index, params",
zip(ct.all_index_types[:6], zip(ct.all_index_types[:7],
ct.default_index_params[:6])) ct.default_index_params[:7]))
def test_search_after_index_different_metric_type(self, dim, index, params, auto_id, _async): def test_search_after_index_different_metric_type(self, dim, index, params, auto_id, _async):
""" """
target: test search with different metric type target: test search with different metric type
@ -2960,8 +2960,8 @@ class TestSearchBase(TestcaseBase):
@pytest.mark.tags(CaseLabel.L2) @pytest.mark.tags(CaseLabel.L2)
@pytest.mark.parametrize("index, params", @pytest.mark.parametrize("index, params",
zip(ct.all_index_types[:6], zip(ct.all_index_types[:7],
ct.default_index_params[:6])) ct.default_index_params[:7]))
def test_search_index_empty_partition(self, index, params): def test_search_index_empty_partition(self, index, params):
""" """
target: test basic search function, all the search params are correct, test all index params, and build target: test basic search function, all the search params are correct, test all index params, and build
@ -3009,8 +3009,8 @@ class TestSearchBase(TestcaseBase):
@pytest.mark.tags(CaseLabel.L2) @pytest.mark.tags(CaseLabel.L2)
@pytest.mark.parametrize("index, params", @pytest.mark.parametrize("index, params",
zip(ct.all_index_types[:6], zip(ct.all_index_types[:7],
ct.default_index_params[:6])) ct.default_index_params[:7]))
def test_search_index_partitions(self, index, params, get_top_k): def test_search_index_partitions(self, index, params, get_top_k):
""" """
target: test basic search function, all the search params are correct, test all index params, and build target: test basic search function, all the search params are correct, test all index params, and build
@ -3069,8 +3069,8 @@ class TestSearchBase(TestcaseBase):
@pytest.mark.tags(CaseLabel.L2) @pytest.mark.tags(CaseLabel.L2)
@pytest.mark.parametrize("index, params", @pytest.mark.parametrize("index, params",
zip(ct.all_index_types[:6], zip(ct.all_index_types[:7],
ct.default_index_params[:6])) ct.default_index_params[:7]))
def test_search_ip_after_index(self, index, params): def test_search_ip_after_index(self, index, params):
""" """
target: test basic search function, all the search params are correct, test all index params, and build target: test basic search function, all the search params are correct, test all index params, and build
@ -3126,8 +3126,8 @@ class TestSearchBase(TestcaseBase):
@pytest.mark.tags(CaseLabel.L2) @pytest.mark.tags(CaseLabel.L2)
@pytest.mark.parametrize("index, params", @pytest.mark.parametrize("index, params",
zip(ct.all_index_types[:6], zip(ct.all_index_types[:7],
ct.default_index_params[:6])) ct.default_index_params[:7]))
def test_search_ip_index_empty_partition(self, index, params): def test_search_ip_index_empty_partition(self, index, params):
""" """
target: test basic search function, all the search params are correct, test all index params, and build target: test basic search function, all the search params are correct, test all index params, and build
@ -3169,8 +3169,8 @@ class TestSearchBase(TestcaseBase):
@pytest.mark.tags(CaseLabel.L2) @pytest.mark.tags(CaseLabel.L2)
@pytest.mark.parametrize("index, params", @pytest.mark.parametrize("index, params",
zip(ct.all_index_types[:6], zip(ct.all_index_types[:7],
ct.default_index_params[:6])) ct.default_index_params[:7]))
def test_search_ip_index_partitions(self, index, params): def test_search_ip_index_partitions(self, index, params):
""" """
target: test basic search function, all the search params are correct, test all index params, and build target: test basic search function, all the search params are correct, test all index params, and build
@ -4101,8 +4101,8 @@ class TestsearchPagination(TestcaseBase):
@pytest.mark.tags(CaseLabel.L2) @pytest.mark.tags(CaseLabel.L2)
@pytest.mark.parametrize("index, params", @pytest.mark.parametrize("index, params",
zip(ct.all_index_types[:6], zip(ct.all_index_types[:7],
ct.default_index_params[:6])) ct.default_index_params[:7]))
def test_search_pagination_after_different_index(self, index, params, auto_id, offset, _async): def test_search_pagination_after_different_index(self, index, params, auto_id, offset, _async):
""" """
target: test search pagination after different index target: test search pagination after different index
@ -4224,7 +4224,6 @@ class TestsearchDiskann(TestcaseBase):
yield request.param yield request.param
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L1)
@pytest.mark.skip(reason="wait to test")
def test_search_with_diskann_index(self, dim, auto_id, _async): def test_search_with_diskann_index(self, dim, auto_id, _async):
""" """
target: test delete after creating index target: test delete after creating index
@ -4264,7 +4263,6 @@ class TestsearchDiskann(TestcaseBase):
) )
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L1)
@pytest.mark.skip(reason="wait to test")
@pytest.mark.parametrize("limit", [20]) @pytest.mark.parametrize("limit", [20])
@pytest.mark.parametrize("search_list", [10, 201]) @pytest.mark.parametrize("search_list", [10, 201])
def test_search_invalid_params_with_diskann_A(self, dim, auto_id, search_list, limit): def test_search_invalid_params_with_diskann_A(self, dim, auto_id, search_list, limit):
@ -4296,7 +4294,6 @@ class TestsearchDiskann(TestcaseBase):
) )
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L1)
@pytest.mark.skip(reason="wait to test")
@pytest.mark.parametrize("limit", [6553]) @pytest.mark.parametrize("limit", [6553])
@pytest.mark.parametrize("search_list", [6553, 65531]) @pytest.mark.parametrize("search_list", [6553, 65531])
def test_search_invalid_params_with_diskann_B(self, dim, auto_id, search_list, limit): def test_search_invalid_params_with_diskann_B(self, dim, auto_id, search_list, limit):
@ -4328,7 +4325,6 @@ class TestsearchDiskann(TestcaseBase):
) )
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L1)
@pytest.mark.skip(reason="wait to test")
@pytest.mark.parametrize("limit", [6554]) @pytest.mark.parametrize("limit", [6554])
@pytest.mark.parametrize("search_list", [6554, 65536]) @pytest.mark.parametrize("search_list", [6554, 65536])
def test_search_invalid_params_with_diskann_C(self, dim, auto_id, search_list, limit): def test_search_invalid_params_with_diskann_C(self, dim, auto_id, search_list, limit):
@ -4359,7 +4355,6 @@ class TestsearchDiskann(TestcaseBase):
"err_msg": "fail to search on all shard leaders"} "err_msg": "fail to search on all shard leaders"}
) )
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L1)
@pytest.mark.skip(reason="wait to test")
def test_search_with_diskann_with_string_pk(self, dim): def test_search_with_diskann_with_string_pk(self, dim):
""" """
target: test delete after creating index target: test delete after creating index
@ -4392,7 +4387,6 @@ class TestsearchDiskann(TestcaseBase):
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L1)
@pytest.mark.skip(reason="wait to test")
def test_search_with_delete_data(self, dim, auto_id, _async): def test_search_with_delete_data(self, dim, auto_id, _async):
""" """
target: test delete after creating index target: test delete after creating index
@ -4435,7 +4429,6 @@ class TestsearchDiskann(TestcaseBase):
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L1)
@pytest.mark.skip(reason="wait to test")
def test_search_with_diskann_and_more_index(self, dim, auto_id, _async): def test_search_with_diskann_and_more_index(self, dim, auto_id, _async):
""" """
target: test delete after creating index target: test delete after creating index

View File

@ -714,6 +714,7 @@ class TestUtilityBase(TestcaseBase):
assert res['total_rows'] == nb assert res['total_rows'] == nb
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L1)
@pytest.mark.skip(reason='wait to modify')
def test_index_process_collection_indexing(self): def test_index_process_collection_indexing(self):
""" """
target: test building_process target: test building_process