test: update test cases (#35640)

Signed-off-by: nico <cheng.yuan@zilliz.com>
This commit is contained in:
nico 2024-08-26 12:00:58 +08:00 committed by GitHub
parent 6ddfd02f01
commit f756f01445
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 14 deletions

View File

@ -849,7 +849,8 @@ class TestConnect(TestcaseBase):
uri = "{}://{}:{}".format(protocol, host, port) uri = "{}://{}:{}".format(protocol, host, port)
self.connection_wrap.connect(alias=connect_name, uri=uri, check_task=ct.CheckTasks.err_res, self.connection_wrap.connect(alias=connect_name, uri=uri, check_task=ct.CheckTasks.err_res,
check_items={ct.err_code: 999, check_items={ct.err_code: 999,
ct.err_msg: "Open local milvus failed, dir: ftp: not exists"}) ct.err_msg: "needs start with [unix, http, https, tcp] "
"or a local file endswith [.db]"})
@pytest.mark.tags(ct.CaseLabel.L2) @pytest.mark.tags(ct.CaseLabel.L2)
@pytest.mark.parametrize("connect_name", [DefaultConfig.DEFAULT_USING]) @pytest.mark.parametrize("connect_name", [DefaultConfig.DEFAULT_USING])

View File

@ -246,11 +246,8 @@ class TestIndexOperation(TestcaseBase):
""" """
schema = cf.gen_array_collection_schema() schema = cf.gen_array_collection_schema()
collection_w = self.init_collection_wrap(schema=schema) collection_w = self.init_collection_wrap(schema=schema)
error = {ct.err_code: 1100, collection_w.create_index(ct.default_string_array_field_name, {})
ct.err_msg: "create index on json field is not supported: expected=supported field, " assert collection_w.index()[0].params == {}
"actual=create index on Array field: invalid parameter"}
collection_w.create_index(ct.default_string_array_field_name, {},
check_task=CheckTasks.err_res, check_items=error)
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L1)
def test_index_collection_empty(self): def test_index_collection_empty(self):
@ -1399,8 +1396,8 @@ class TestIndexInvalid(TestcaseBase):
expected: raise exception expected: raise exception
""" """
collection_w = self.init_collection_general(prefix, is_index=False, is_all_data_type=True)[0] collection_w = self.init_collection_general(prefix, is_index=False, is_all_data_type=True)[0]
scalar_index = ["Trie", "STL_SORT", "INVERTED"] scalar_index = ["Trie", "STL_SORT"]
scalar_fields = [ct.default_string_field_name, ct.default_int16_field_name, ct.default_int32_field_name] scalar_fields = [ct.default_string_field_name, ct.default_int16_field_name]
for i in range(len(scalar_fields)): for i in range(len(scalar_fields)):
index_name = f"scalar_index_name_{i}" index_name = f"scalar_index_name_{i}"
scalar_index_params = {"index_type": f"{scalar_index[i]}"} scalar_index_params = {"index_type": f"{scalar_index[i]}"}

View File

@ -390,7 +390,8 @@ class TestInsertParams(TestcaseBase):
data = cf.gen_default_list_data(nb=100) data = cf.gen_default_list_data(nb=100)
data[0][1] = 1.0 data[0][1] = 1.0
error = {ct.err_code: 999, error = {ct.err_code: 999,
ct.err_msg: "The Input data type is inconsistent with defined schema, please check it."} ct.err_msg: "The Input data type is inconsistent with defined schema, {%s} field should be a int64, "
"but got a {<class 'int'>} instead." % ct.default_int64_field_name}
collection_w.insert(data, check_task=CheckTasks.err_res, check_items=error) collection_w.insert(data, check_task=CheckTasks.err_res, check_items=error)
@ -2091,7 +2092,7 @@ class TestUpsertInvalid(TestcaseBase):
check_task=CheckTasks.err_res, check_items=error) check_task=CheckTasks.err_res, check_items=error)
@pytest.mark.tags(CaseLabel.L2) @pytest.mark.tags(CaseLabel.L2)
@pytest.mark.xfail("insert and upsert have removed the [] error check") @pytest.mark.skip("insert and upsert have removed the [] error check")
def test_upsert_multi_partitions(self): def test_upsert_multi_partitions(self):
""" """
target: test upsert two partitions target: test upsert two partitions
@ -2106,7 +2107,7 @@ class TestUpsertInvalid(TestcaseBase):
cf.insert_data(collection_w) cf.insert_data(collection_w)
data = cf.gen_default_dataframe_data(nb=1000) data = cf.gen_default_dataframe_data(nb=1000)
error = {ct.err_code: 999, ct.err_msg: "['partition_1', 'partition_2'] has type <class 'list'>, " error = {ct.err_code: 999, ct.err_msg: "['partition_1', 'partition_2'] has type <class 'list'>, "
"but expected one of: (<class 'bytes'>, <class 'str'>)"} "but expected one of: (<class 'bytes'>, <class 'str'>)"}
collection_w.upsert(data=data, partition_name=["partition_1", "partition_2"], collection_w.upsert(data=data, partition_name=["partition_1", "partition_2"],
check_task=CheckTasks.err_res, check_items=error) check_task=CheckTasks.err_res, check_items=error)

View File

@ -369,7 +369,8 @@ class TestPartitionParams(TestcaseBase):
# load with 2 replicas # load with 2 replicas
error = {ct.err_code: 65535, error = {ct.err_code: 65535,
ct.err_msg: "failed to load partitions: failed to spawn replica for collection: nodes not enough"} ct.err_msg: "failed to spawn replica for collection: resource group node not enough"
"[rg=__default_resource_group]"}
collection_w.create_index(ct.default_float_vec_field_name, index_params=ct.default_flat_index) collection_w.create_index(ct.default_float_vec_field_name, index_params=ct.default_flat_index)
partition_w.load(replica_number=3, check_task=CheckTasks.err_res, check_items=error) partition_w.load(replica_number=3, check_task=CheckTasks.err_res, check_items=error)
@ -396,8 +397,8 @@ class TestPartitionParams(TestcaseBase):
partition_w.load(replica_number=1) partition_w.load(replica_number=1)
collection_w.query(expr=f"{ct.default_int64_field_name} in [0]", check_task=CheckTasks.check_query_results, collection_w.query(expr=f"{ct.default_int64_field_name} in [0]", check_task=CheckTasks.check_query_results,
check_items={'exp_res': [{'int64': 0}]}) check_items={'exp_res': [{'int64': 0}]})
error = {ct.err_code: 1100, ct.err_msg: "failed to load partitions: can't change the replica number for " error = {ct.err_code: 1100, ct.err_msg: "call query coordinator LoadCollection: can't change the replica number"
"loaded partitions: expected=1, actual=2: invalid parameter"} " for loaded collection: invalid parameter[expected=1][actual=2]"}
partition_w.load(replica_number=2, check_task=CheckTasks.err_res, check_items=error) partition_w.load(replica_number=2, check_task=CheckTasks.err_res, check_items=error)
partition_w.release() partition_w.release()