Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
90230732
M
milvus
项目概览
milvus
/
milvus
大约 1 年 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
90230732
编写于
6月 11, 2021
作者:
Y
yanliang567
提交者:
GitHub
6月 11, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[skip ci] Update partition tests for fixed issues. (#5728)
Signed-off-by:
N
yanliang567
<
yanliang.qiao@zilliz.com
>
上级
006dae35
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
18 deletion
+16
-18
tests20/python_client/common/common_func.py
tests20/python_client/common/common_func.py
+0
-1
tests20/python_client/testcases/test_partition.py
tests20/python_client/testcases/test_partition.py
+10
-12
tests20/python_client/utils/api_request.py
tests20/python_client/utils/api_request.py
+6
-5
未找到文件。
tests20/python_client/common/common_func.py
浏览文件 @
90230732
...
...
@@ -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
...
...
tests20/python_client/testcases/test_partition.py
浏览文件 @
90230732
...
...
@@ -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
)
...
...
tests20/python_client/utils/api_request.py
浏览文件 @
90230732
...
...
@@ -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_res
ponse
) 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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录