mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 01:58:34 +08:00
Modify nightly test cases (#27517)
Signed-off-by: zilliz <zilliz@zillizdeMacBook-Pro.local> Co-authored-by: zilliz <zilliz@zillizdeMacBook-Pro.local>
This commit is contained in:
parent
2d58691126
commit
f9137d880b
@ -2151,7 +2151,7 @@ class TestUpsertInvalid(TestcaseBase):
|
|||||||
collection_w = self.init_collection_wrap(name=c_name)
|
collection_w = self.init_collection_wrap(name=c_name)
|
||||||
data = cf.gen_default_dataframe_data(nb=2)
|
data = cf.gen_default_dataframe_data(nb=2)
|
||||||
partition_name = "partition1"
|
partition_name = "partition1"
|
||||||
error = {ct.err_code: 1, ct.err_msg: "partition is not exist: partition1"}
|
error = {ct.err_code: 15, ct.err_msg: f"partition={partition_name}: partition not found"}
|
||||||
collection_w.upsert(data=data, partition_name=partition_name,
|
collection_w.upsert(data=data, partition_name=partition_name,
|
||||||
check_task=CheckTasks.err_res, check_items=error)
|
check_task=CheckTasks.err_res, check_items=error)
|
||||||
|
|
||||||
|
|||||||
@ -7250,28 +7250,33 @@ class TestCollectionRangeSearch(TestcaseBase):
|
|||||||
is_index=False)[0:4]
|
is_index=False)[0:4]
|
||||||
|
|
||||||
# 2. create index
|
# 2. create index
|
||||||
index_param = {"index_type": "IVF_FLAT",
|
index_param = {"index_type": "IVF_FLAT", "metric_type": "L2", "params": {"nlist": 100}}
|
||||||
"metric_type": "L2", "params": {"nlist": 100}}
|
|
||||||
collection_w.create_index("float_vector", index_param)
|
collection_w.create_index("float_vector", index_param)
|
||||||
collection_w.load()
|
collection_w.load()
|
||||||
|
|
||||||
# 3. search with expression
|
# 3. search with expression
|
||||||
expression = f"0 < {default_int64_field_name} < 5001"
|
expression = f"0 < {default_int64_field_name} < 5001"
|
||||||
log.info(
|
log.info("test_search_with_expression: searching with expression: %s" % expression)
|
||||||
"test_search_with_expression: searching with expression: %s" % expression)
|
|
||||||
|
|
||||||
nums = 5000
|
nums = 5000
|
||||||
vectors = [[random.random() for _ in range(dim)] for _ in range(nums)]
|
vectors = [[random.random() for _ in range(dim)] for _ in range(nums)]
|
||||||
range_search_params = {"metric_type": "L2", "params": {"radius": 1000,
|
# calculate the distance to make sure in range(0, 1000)
|
||||||
"range_filter": 0}}
|
search_params = {"metric_type": "L2"}
|
||||||
search_res, _ = collection_w.search(vectors, default_search_field,
|
search_res, _ = collection_w.search(vectors, default_search_field,
|
||||||
range_search_params, default_limit, expression,
|
search_params, 500, expression)
|
||||||
check_task=CheckTasks.check_search_results,
|
for i in range(nums):
|
||||||
check_items={
|
if len(search_res[i]) < 10:
|
||||||
"nq": nums,
|
assert False
|
||||||
"ids": insert_ids,
|
for j in range(len(search_res[i])):
|
||||||
"limit": default_limit,
|
if search_res[i][j].distance < 0 or search_res[i][j].distance >= 1000:
|
||||||
})
|
assert False
|
||||||
|
# range search
|
||||||
|
range_search_params = {"metric_type": "L2", "params": {"radius": 1000, "range_filter": 0}}
|
||||||
|
search_res, _ = collection_w.search(vectors, default_search_field,
|
||||||
|
range_search_params, default_limit, expression)
|
||||||
|
for i in range(nums):
|
||||||
|
log.info(i)
|
||||||
|
assert len(search_res[i]) == default_limit
|
||||||
|
|
||||||
@pytest.mark.tags(CaseLabel.L2)
|
@pytest.mark.tags(CaseLabel.L2)
|
||||||
def test_range_search_with_consistency_bounded(self, nq, dim, auto_id, _async):
|
def test_range_search_with_consistency_bounded(self, nq, dim, auto_id, _async):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user