[skip ci] Update partition tests for fixed issues. (#5728)

Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
pull/5741/head
yanliang567 2021-06-11 10:02:50 +08:00 committed by GitHub
parent 006dae35c3
commit 902307327b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 18 deletions

View File

@ -57,7 +57,6 @@ def gen_default_collection_schema(description=ct.default_desc, primary_field=Non
fields = [gen_int64_field(), gen_float_field(), gen_float_vec_field()]
schema, _ = ApiCollectionSchemaWrapper().init_collection_schema(fields=fields, description=description,
primary_field=primary_field)
log.error(schema)
return schema

View File

@ -282,7 +282,6 @@ class TestPartitionParams(TestcaseBase):
assert len(res1) == 0 and len(res2) == 1
@pytest.mark.tags(CaseLabel.L1)
@pytest.mark.xfail(reason="issue #5302")
@pytest.mark.parametrize("partition_name", [cf.gen_unique_str(prefix)])
@pytest.mark.parametrize("data, nums", [(cf.gen_default_dataframe_data(10), 10),
(cf.gen_default_list_data(1), 1),
@ -307,13 +306,13 @@ class TestPartitionParams(TestcaseBase):
# insert data
partition_w.insert(data)
# TODO need a flush before assert
self._connect().flush([collection_w.name])
assert not partition_w.is_empty
assert partition_w.num_entities == nums
# insert data
partition_w.insert(data)
# TODO need a flush before assert
self._connect().flush([collection_w.name])
assert not partition_w.is_empty
assert partition_w.num_entities == (nums + nums)
@ -503,8 +502,7 @@ class TestPartitionOperations(TestcaseBase):
# flush
if flush:
# TODO: self.partition_wrap.flush()
pass
self._connect().flush([collection_w.name])
# drop partition
partition_w.drop()
@ -539,8 +537,7 @@ class TestPartitionOperations(TestcaseBase):
# flush
if flush:
# TODO: self.partition_wrap.flush()
pass
self._connect().flush([collection_w.name])
# drop partition
partition_w.drop()
@ -650,7 +647,6 @@ class TestPartitionOperations(TestcaseBase):
partition_w.release()
@pytest.mark.tags(CaseLabel.L1)
@pytest.mark.xfail(reason="issue #5302")
@pytest.mark.parametrize("partition_name, data", [(ct.default_partition_name, cf.gen_default_dataframe_data())])
def test_partition_insert_default_partition(self, partition_name, data):
"""
@ -668,7 +664,7 @@ class TestPartitionOperations(TestcaseBase):
# insert data to partition
partition_w.insert(data)
# TODO: need a flush here
self._connect().flush([collection_w.name])
assert partition_w.num_entities == len(data)
@pytest.mark.tags(CaseLabel.L1)
@ -716,7 +712,6 @@ class TestPartitionOperations(TestcaseBase):
check_items={"err_code": 1, "err_msg": "None Type"})
@pytest.mark.tags(CaseLabel.L1)
@pytest.mark.xfail(reason="issue #5302")
def test_partition_insert_maximum_size_data(self, data):
"""
target: verify insert maximum size data(256M?) a time
@ -724,13 +719,16 @@ class TestPartitionOperations(TestcaseBase):
2. insert maximum size data
expected: insert successfully
"""
# create collection
collection_w = self.init_collection_wrap()
# create partition
partition_w = self.init_partition_wrap()
partition_w = self.init_partition_wrap(collection_w)
# insert data to partition
max_size = 100000 # TODO: clarify the max size of data
partition_w.insert(cf.gen_default_dataframe_data(max_size))
# TODO: need a flush for #5302
self._connect().flush([collection_w.name])
assert partition_w.num_entities == max_size
@pytest.mark.tags(CaseLabel.L1)

View File

@ -16,15 +16,14 @@ def api_request_catch():
def inner_wrapper(*args, **kwargs):
try:
res = func(*args, **kwargs)
log.debug("(api_res) Response : %s " % str(res)[0:log_row_length])
log.debug("(api_response) Response : %s " % str(res)[0:log_row_length])
return res, True
except Exception as e:
log.error(traceback.format_exc())
log.error("(api_res) [Milvus API Exception]%s: %s" % (str(func), str(e)[0:log_row_length]))
log.error("(api_response) [Milvus API Exception]%s: %s"
% (str(func), str(e)[0:log_row_length]))
return Error(e), False
return inner_wrapper
return wrapper
@ -37,6 +36,8 @@ def api_request(_list, **kwargs):
if len(_list) > 1:
for a in _list[1:]:
arg.append(a)
log.info("(api_req)[%s] Parameters ars arg: %s, kwargs: %s" % (str(func), str(arg), str(kwargs)))
log.debug("(api_request) Request: [%s] args: %s, kwargs: %s"
% (str(func), str(arg)[0:log_row_length], str(kwargs)))
return func(*arg, **kwargs)
return False, False