Modify test cases (#23939)

Signed-off-by: nico <cheng.yuan@zilliz.com>
This commit is contained in:
nico 2023-05-09 13:16:40 +08:00 committed by GitHub
parent de4b4dafef
commit f2c902e39e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 11 deletions

View File

@ -115,13 +115,13 @@ class TestcaseBase(Base):
port=cf.param_info.param_port)
return res
def init_collection_wrap(self, name=None, schema=None, shards_num=2, check_task=None, check_items=None, **kwargs):
def init_collection_wrap(self, name=None, schema=None, check_task=None, check_items=None, **kwargs):
name = cf.gen_unique_str('coll_') if name is None else name
schema = cf.gen_default_collection_schema() if schema is None else schema
if not self.connection_wrap.has_connection(alias=DefaultConfig.DEFAULT_USING)[0]:
self._connect()
collection_w = ApiCollectionWrapper()
collection_w.init_collection(name=name, schema=schema, shards_num=shards_num, check_task=check_task,
collection_w.init_collection(name=name, schema=schema, check_task=check_task,
check_items=check_items, **kwargs)
self.collection_object_list.append(collection_w)
return collection_w

View File

@ -63,6 +63,7 @@ max_field_num = 64 # Maximum number of fields in a collection
max_name_length = 255 # Maximum length of name for a collection or alias
default_replica_num = 1
default_graceful_time = 5 #
default_shards_num = 1
max_shards_num = 16
IMAGE_REPOSITORY_MILVUS = "harbor.milvus.io/dockerhub/milvusdb/milvus"
NAMESPACE_CHAOS_TESTING = "chaos-testing"

View File

@ -1,3 +1,5 @@
import random
import numpy
import pandas as pd
import pytest
@ -2262,7 +2264,7 @@ class TestLoadCollection(TestcaseBase):
collection_w.load()
@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.skip(reason="issue #23499")
# @pytest.mark.skip(reason="issue #23499")
def test_load_partitions_after_release_partition(self):
"""
target: test load collection after release partition and load partitions
@ -2286,7 +2288,7 @@ class TestLoadCollection(TestcaseBase):
partition_w2.load()
@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.skip(reason="issue #23499")
# @pytest.mark.skip(reason="issue #23499")
def test_load_collection_after_release_partition_collection(self):
"""
target: test load collection after release partition and collection
@ -2303,7 +2305,7 @@ class TestLoadCollection(TestcaseBase):
collection_w.load()
partition_w.release()
error = {ct.err_code: 1, ct.err_msg: 'not loaded into memory'}
collection_w.query(default_term_expr, partition_names=[partition2],
collection_w.query(default_term_expr, partition_names=[partition1],
check_task=CheckTasks.err_res, check_items=error)
collection_w.release()
collection_w.load()
@ -2406,6 +2408,7 @@ class TestLoadCollection(TestcaseBase):
partition_w1 = self.init_partition_wrap(collection_w, partition1)
partition_w2 = self.init_partition_wrap(collection_w, partition2)
collection_w.load()
partition_w1.release()
partition_w1.drop()
partition_w2.release()
partition_w2.load()
@ -2425,6 +2428,7 @@ class TestLoadCollection(TestcaseBase):
partition_w1 = self.init_partition_wrap(collection_w, partition1)
partition_w2 = self.init_partition_wrap(collection_w, partition2)
collection_w.load()
partition_w1.release()
partition_w1.drop()
partition_w2.load()
collection_w.query(default_term_expr, partition_names=[partition2])
@ -2443,6 +2447,7 @@ class TestLoadCollection(TestcaseBase):
partition_w1 = self.init_partition_wrap(collection_w, partition1)
partition_w2 = self.init_partition_wrap(collection_w, partition2)
collection_w.load()
partition_w1.release()
partition_w1.drop()
collection_w.load()
collection_w.query(default_term_expr, partition_names=[partition2])
@ -2918,7 +2923,7 @@ class TestDescribeCollection(TestcaseBase):
c_name = cf.gen_unique_str(prefix)
collection_w = self.init_collection_wrap(name=c_name)
collection_w.create_index(ct.default_float_vec_field_name, index_params=ct.default_flat_index)
description = {'collection_name': c_name, 'auto_id': False, 'description': '',
description = {'collection_name': c_name, 'auto_id': False, 'num_shards': ct.default_shards_num, 'description': '',
'fields': [{'field_id': 100, 'name': 'int64', 'description': '', 'type': 5,
'params': {}, 'is_primary': True, 'auto_id': False},
{'field_id': 101, 'name': 'float', 'description': '', 'type': 10,
@ -3417,11 +3422,13 @@ class TestLoadPartition(TestcaseBase):
partition_w1 = self.init_partition_wrap(collection_w, partition1)
partition_w2 = self.init_partition_wrap(collection_w, partition2)
partition_w1.load()
partition_w1.release()
partition_w1.drop()
partition_w2.load()
collection_w.query(default_term_expr, partition_names=[partition2])
@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.skip(reason="issue #23937")
def test_load_collection_after_load_drop_partition(self):
"""
target: test load collection after load and drop partition
@ -3437,6 +3444,7 @@ class TestLoadPartition(TestcaseBase):
partition_w1 = self.init_partition_wrap(collection_w, partition1)
partition_w2 = self.init_partition_wrap(collection_w, partition2)
partition_w1.load()
partition_w1.release()
partition_w1.drop()
error = {ct.err_code: 1, ct.err_msg: 'name not found'}
collection_w.query(default_term_expr, partition_names=[partition1, partition2],
@ -3446,7 +3454,7 @@ class TestLoadPartition(TestcaseBase):
collection_w.query(default_term_expr)
@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.skip(reason="issue #23048")
@pytest.mark.skip(reason="issue #23536")
def test_release_load_partition_after_load_drop_partition(self):
"""
target: test release load partition after load and drop partition
@ -3460,12 +3468,13 @@ class TestLoadPartition(TestcaseBase):
partition_w1 = self.init_partition_wrap(collection_w, partition1)
partition_w2 = self.init_partition_wrap(collection_w, partition2)
partition_w1.load()
partition_w1.release()
partition_w1.drop()
partition_w2.release()
partition_w2.load()
collection_w.query(default_term_expr, partition_names=[partition2])
@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.skip(reason="issue #23048")
def test_release_load_collection_after_load_drop_partition(self):
"""
target: test release load partition after load and drop partition
@ -3479,9 +3488,11 @@ class TestLoadPartition(TestcaseBase):
partition_w1 = self.init_partition_wrap(collection_w, partition1)
partition_w2 = self.init_partition_wrap(collection_w, partition2)
partition_w1.load()
partition_w1.release()
partition_w1.drop()
partition_w2.release()
partition_w2.load()
collection_w.load()
collection_w.query(default_term_expr)
@pytest.mark.tags(CaseLabel.L2)
def test_load_another_partition_after_load_drop_partition(self):

View File

@ -1090,6 +1090,7 @@ class TestCollectionSearchInvalid(TestcaseBase):
"err_msg": f"not implemented"})
@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.skip(reason="It will report error before range search")
@pytest.mark.parametrize("metric", ["SUPERSTRUCTURE", "SUBSTRUCTURE"])
def test_range_search_data_type_metric_type_mismatch(self, metric):
"""
@ -1790,7 +1791,7 @@ class TestCollectionSearch(TestcaseBase):
dim = M * 4
ef = limit
self._connect()
collection_w, _, _, insert_ids, time_stamp = self.init_collection_general(prefix, True,
collection_w, _, _, insert_ids, time_stamp = self.init_collection_general(prefix, True, 5000,
partition_num=1,
auto_id=auto_id,
dim=dim, is_index=False)[0:5]
@ -2964,7 +2965,7 @@ class TestCollectionSearch(TestcaseBase):
if vectorInsert != vectorRes:
getcontext().rounding = getattr(decimal, 'ROUND_HALF_UP')
vectorInsert = Decimal(data[field_name][res[0][_id].id][i]).quantize(Decimal('0.00000'))
assert str(vectorInsert) == vectorRes
assert float(str(vectorInsert)) == float(vectorRes)
@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.skip(reason="issue #23661")