test: update test cases and pymilvus version (#28746)

pr: #28706

Signed-off-by: nico <cheng.yuan@zilliz.com>
pull/28813/head
nico 2023-11-29 10:28:29 +08:00 committed by GitHub
parent 0688ec4d83
commit a3aceb97a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 35 deletions

View File

@ -12,7 +12,7 @@ allure-pytest==2.7.0
pytest-print==0.2.1
pytest-level==0.1.1
pytest-xdist==2.5.0
pymilvus==2.3.2.post1.dev5
pymilvus==2.3.3.post1.dev3
pytest-rerunfailures==9.1.1
git+https://github.com/Projectplace/pytest-tags
ndg-httpsclient

View File

@ -1103,7 +1103,7 @@ class TestCollectionOperation(TestcaseBase):
fields = []
for k, v in DataType.__members__.items():
if v and v != DataType.UNKNOWN and v != DataType.STRING \
and v != DataType.VARCHAR and v != DataType.FLOAT_VECTOR and v != DataType.FLOAT16_VECTOR\
and v != DataType.VARCHAR and v != DataType.FLOAT_VECTOR \
and v != DataType.BINARY_VECTOR and v != DataType.ARRAY:
field, _ = self.field_schema_wrap.init_field_schema(name=k.lower(), dtype=v)
fields.append(field)
@ -3335,10 +3335,9 @@ class TestLoadPartition(TestcaseBase):
description=description,
check_task=CheckTasks.check_partition_property,
check_items={"name": partition_name, "description": description,
"is_empty": True, "num_entities": 0}
)
"is_empty": True, "num_entities": 0})
partition_w.drop()
error = {ct.err_code: 1, ct.err_msg: 'partitionID of partitionName:%s can not be find' % partition_name}
error = {ct.err_code: 200, ct.err_msg: 'partition not found[partition=%s]' % partition_name}
partition_w.release(check_task=CheckTasks.err_res, check_items=error)
@pytest.mark.tags(CaseLabel.L0)

View File

@ -144,7 +144,8 @@ class TestHighLevelApi(TestcaseBase):
rng = np.random.default_rng(seed=19530)
vectors_to_search = rng.random((1, 8))
search_params = {"metric_type": metric_type}
error = {ct.err_code: 1, ct.err_msg: f"metric type not match: expected=IP, actual={metric_type}"}
error = {ct.err_code: 65535, ct.err_msg: f"metric type not match: invalid "
f"parameter[expected=IP][actual={metric_type}]"}
client_w.search(client, collection_name, vectors_to_search, limit=default_limit,
search_params=search_params,
check_task=CheckTasks.err_res, check_items=error)

View File

@ -1150,7 +1150,7 @@ class TestInsertAsync(TestcaseBase):
collection_w = self.init_collection_wrap(
name=cf.gen_unique_str(prefix))
df = cf.gen_default_dataframe_data()
err_msg = "partition=p: partition not found"
err_msg = "partition not found"
future, _ = collection_w.insert(
data=df, partition_name="p", _async=True)
future.done()
@ -2142,7 +2142,7 @@ class TestUpsertInvalid(TestcaseBase):
collection_w = self.init_collection_wrap(name=c_name)
data = cf.gen_default_dataframe_data(nb=2)
partition_name = "partition1"
error = {ct.err_code: 15, ct.err_msg: f"partition={partition_name}: partition not found"}
error = {ct.err_code: 200, ct.err_msg: f"partition not found[partition={partition_name}]"}
collection_w.upsert(data=data, partition_name=partition_name,
check_task=CheckTasks.err_res, check_items=error)

View File

@ -720,8 +720,7 @@ class TestPartitionOperations(TestcaseBase):
assert not collection_w.has_partition(partition_name)[0]
# verify that drop the partition again with exception
partition_w.drop(check_task=CheckTasks.err_res,
check_items={ct.err_code: 1, ct.err_msg: PartitionErrorMessage.PartitionNotExist})
partition_w.drop()
@pytest.mark.tags(CaseLabel.L2)
def test_partition_create_and_drop_multi_times(self):
@ -947,7 +946,8 @@ class TestPartitionOperations(TestcaseBase):
# insert data to partition
partition_w.insert(cf.gen_default_dataframe_data(),
check_task=CheckTasks.err_res,
check_items={ct.err_code: 1, ct.err_msg: "Partition not exist"})
check_items={ct.err_code: 200,
ct.err_msg: "partition not found[partition=%s]" % partition_w.name})
# TODO: update the assert error
@pytest.mark.tags(CaseLabel.L1)
@ -1095,7 +1095,8 @@ class TestPartitionOperations(TestcaseBase):
# insert data to partition
partition_w.upsert(cf.gen_default_dataframe_data(),
check_task=CheckTasks.err_res,
check_items={ct.err_code: 1, ct.err_msg: "Partition not exist"})
check_items={ct.err_code: 200,
ct.err_msg: "partition not found[partition=%s]" % partition_w.name})
@pytest.mark.tags(CaseLabel.L2)
def test_partition_upsert_mismatched_data(self):

View File

@ -343,7 +343,7 @@ class TestCollectionSearchInvalid(TestcaseBase):
search_params, default_limit,
default_search_exp,
check_task=CheckTasks.err_res,
check_items={"err_code": 65538,
check_items={"err_code": 65535,
"err_msg": "failed to search"})
@pytest.mark.skip("not fixed yet")
@ -873,14 +873,9 @@ class TestCollectionSearchInvalid(TestcaseBase):
collection_w.search(vectors[:default_nq], default_search_field,
search_params, reorder_k + 1,
check_task=CheckTasks.err_res,
check_items={"err_code": 65538,
"err_msg": "failed to search: attempt #0: failed to search/query "
"delegator 1 for channel by-dev-rootcoord-dml_12_44501"
"8735380972010v0: fail to Search, QueryNode ID=1, reaso"
"n=worker(1) query failed: UnknownError: => failed to "
"search: out of range in json: reorder_k(100) should be"
" larger than k(101): attempt #1: no available shard de"
"legator found: service unavailable"})
check_items={"err_code": 65535,
"err_msg": f"reorder_k({reorder_k}) should be larger than "
f"k({reorder_k + 1})"})
@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.parametrize("nq", [16385])
@ -942,8 +937,9 @@ class TestCollectionSearchInvalid(TestcaseBase):
collection_w.search(binary_vectors[:default_nq], "binary_vector",
search_params, default_limit, "int64 >= 0",
check_task=CheckTasks.err_res,
check_items={"err_code": 65538, "err_msg": "metric type not match: "
"expected=JACCARD, actual=L2"})
check_items={"err_code": 65535,
"err_msg": "metric type not match: invalid parameter"
"[expected=JACCARD][actual=L2]"})
@pytest.mark.tags(CaseLabel.L2)
def test_search_with_output_fields_not_exist(self):
@ -6053,7 +6049,7 @@ class TestSearchDiskann(TestcaseBase):
default_search_exp,
output_fields=output_fields,
check_task=CheckTasks.err_res,
check_items={"err_code": 65538,
check_items={"err_code": 65535,
"err_msg": "fail to search on all shard leaders"})
@pytest.mark.tags(CaseLabel.L2)
@ -6511,8 +6507,9 @@ class TestCollectionRangeSearch(TestcaseBase):
range_search_params, default_limit,
default_search_exp,
check_task=CheckTasks.err_res,
check_items={ct.err_code: 1,
ct.err_msg: "metric type not match: expected=COSINE, actual=IP"})
check_items={ct.err_code: 65535,
ct.err_msg: "metric type not match: invalid parameter"
"[expected=COSINE][actual=IP]"})
@pytest.mark.tags(CaseLabel.L2)
def test_range_search_only_radius(self):
@ -6544,8 +6541,9 @@ class TestCollectionRangeSearch(TestcaseBase):
range_search_params, default_limit,
default_search_exp,
check_task=CheckTasks.err_res,
check_items={ct.err_code: 1,
ct.err_msg: "metric type not match: expected=L2, actual=IP"})
check_items={ct.err_code: 65535,
ct.err_msg: "metric type not match: invalid parameter"
"[expected=L2][actual=IP]"})
@pytest.mark.tags(CaseLabel.L2)
def test_range_search_radius_range_filter_not_in_params(self):
@ -6577,8 +6575,9 @@ class TestCollectionRangeSearch(TestcaseBase):
range_search_params, default_limit,
default_search_exp,
check_task=CheckTasks.err_res,
check_items={ct.err_code: 1,
ct.err_msg: "metric type not match: expected=COSINE, actual=IP"})
check_items={ct.err_code: 65535,
ct.err_msg: "metric type not match: invalid parameter"
"[expected=COSINE][actual=IP]"})
@pytest.mark.tags(CaseLabel.L1)
@pytest.mark.parametrize("dup_times", [1, 2])

View File

@ -245,7 +245,7 @@ class TestUtilityParams(TestcaseBase):
self.collection_wrap.construct_from_dataframe(c_name, df, primary_field=ct.default_int64_field_name)
self.collection_wrap.create_index(ct.default_float_vec_field_name, index_params=ct.default_flat_index)
self.collection_wrap.load()
error = {ct.err_code: 4, ct.err_msg: "collection default:not_existed_name: collection not found"}
error = {ct.err_code: 100, ct.err_msg: "collection not found[database=default][collection=not_existed_name]"}
self.utility_wrap.loading_progress("not_existed_name", check_task=CheckTasks.err_res, check_items=error)
@pytest.mark.tags(CaseLabel.L2)
@ -289,7 +289,7 @@ class TestUtilityParams(TestcaseBase):
self.utility_wrap.wait_for_loading_complete(
c_name,
check_task=CheckTasks.err_res,
check_items={ct.err_code: 4, ct.err_msg: f"collection default:{c_name}: collection not found"})
check_items={ct.err_code: 100, ct.err_msg: f"collection not found[database=default][collection={c_name}]"})
@pytest.mark.tags(CaseLabel.L2)
def test_wait_for_loading_partition_not_existed(self):
@ -607,9 +607,9 @@ class TestUtilityParams(TestcaseBase):
new_collection_name = cf.gen_unique_str(prefix)
self.utility_wrap.rename_collection(old_collection_name, new_collection_name,
check_task=CheckTasks.err_res,
check_items={"err_code": 4,
"err_msg": "collection 1:test_collection_non_exist: "
"collection not found"})
check_items={"err_code": 100,
"err_msg": "collection not found[database=1][collection="
"%s]" % old_collection_name})
@pytest.mark.tags(CaseLabel.L1)
def test_rename_collection_existed_collection_name(self):