Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
c88a6ecd
M
milvus
项目概览
milvus
/
milvus
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
未验证
提交
c88a6ecd
编写于
10月 29, 2021
作者:
T
ThreadDao
提交者:
GitHub
10月 29, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update delete cases (#10926)
Signed-off-by:
N
ThreadDao
<
yufen.zong@zilliz.com
>
上级
390fad4e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
25 deletion
+14
-25
tests/python_client/testcases/test_delete_20.py
tests/python_client/testcases/test_delete_20.py
+14
-25
未找到文件。
tests/python_client/testcases/test_delete_20.py
浏览文件 @
c88a6ecd
...
...
@@ -16,7 +16,7 @@ query_res_tmp_expr = [{f'{ct.default_int64_field_name}': 0}]
exp_res
=
"exp_res"
@
pytest
.
mark
.
skip
(
reason
=
"Delete API disabled"
)
@
pytest
.
mark
.
xfail
(
reason
=
"Delete API disabled"
)
class
TestDeleteParams
(
TestcaseBase
):
"""
Test case of delete interface
...
...
@@ -131,7 +131,6 @@ class TestDeleteParams(TestcaseBase):
expr
=
f
'
{
ct
.
default_int64_field_name
}
in
{
[
0
]
}
'
del_res
,
_
=
collection_w
.
delete
(
expr
)
assert
del_res
.
delete_count
==
1
time
.
sleep
(
1
)
collection_w
.
query
(
expr
,
check_task
=
CheckTasks
.
check_query_empty
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L1
)
...
...
@@ -150,7 +149,6 @@ class TestDeleteParams(TestcaseBase):
assert
del_res
.
delete_count
==
ct
.
default_nb
assert
collection_w
.
num_entities
==
ct
.
default_nb
time
.
sleep
(
1
)
collection_w
.
query
(
expr
,
check_task
=
CheckTasks
.
check_query_empty
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L1
)
...
...
@@ -222,7 +220,6 @@ class TestDeleteParams(TestcaseBase):
assert
del_res
.
delete_count
==
1
# query with deleted id and query with existed id
time
.
sleep
(
1
)
collection_w
.
query
(
tmp_expr
,
check_task
=
CheckTasks
.
check_query_empty
,
partition_names
=
[
partition_w
.
name
])
res
=
df
.
iloc
[
1
:
2
,
:
1
].
to_dict
(
'records'
)
collection_w
.
query
(
f
'
{
ct
.
default_int64_field_name
}
in [1]'
,
...
...
@@ -257,7 +254,7 @@ class TestDeleteParams(TestcaseBase):
collection_w
.
delete
(
tmp_expr
,
partition_name
=
partition_name
,
check_task
=
CheckTasks
.
err_res
,
check_items
=
error
)
@
pytest
.
mark
.
skip
(
reason
=
"Delete API disabled"
)
@
pytest
.
mark
.
xfail
(
reason
=
"Delete API disabled"
)
class
TestDeleteOperation
(
TestcaseBase
):
"""
******************************************************************
...
...
@@ -313,6 +310,7 @@ class TestDeleteOperation(TestcaseBase):
assert
collection_w
.
num_entities
==
tmp_nb
-
1
assert
collection_w
.
has_index
()
@
pytest
.
mark
.
xfail
(
reason
=
"Issue #10919"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_delete_query_ids_both_sealed_and_channel
(
self
):
"""
...
...
@@ -454,7 +452,6 @@ class TestDeleteOperation(TestcaseBase):
# delete entities from own partition
collection_w
.
delete
(
expr
,
partition_name
=
partition_w
.
name
)
time
.
sleep
(
1
)
collection_w
.
query
(
expr
,
check_task
=
CheckTasks
.
check_query_empty
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L1
)
...
...
@@ -501,7 +498,6 @@ class TestDeleteOperation(TestcaseBase):
# verify delete result
assert
res
.
delete_count
==
1
time
.
sleep
(
1
)
collection_w
.
query
(
expr
,
check_task
=
CheckTasks
.
check_query_empty
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
...
...
@@ -528,7 +524,7 @@ class TestDeleteOperation(TestcaseBase):
collection_w
.
query
(
expr
=
tmp_expr
,
check_task
=
CheckTasks
.
err_res
,
check_items
=
error
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L1
)
def
test_delete_without_flush
(
self
):
def
test_delete_
sealed_segment_
without_flush
(
self
):
"""
target: test delete without flush
method: 1.insert and flush data
...
...
@@ -548,13 +544,12 @@ class TestDeleteOperation(TestcaseBase):
# load and query with id
collection_w
.
load
()
time
.
sleep
(
1
)
collection_w
.
query
(
tmp_expr
,
check_task
=
CheckTasks
.
check_query_empty
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L1
)
def
test_delete_
data_from_growing_segment
(
self
):
def
test_delete_
growing_data_channel_delete
(
self
):
"""
target: test delete entities from growing segment
target: test delete entities from growing segment
, and channel deleteMsg
method: 1.create collection
2.load collection
3.insert data and delete ids
...
...
@@ -572,11 +567,10 @@ class TestDeleteOperation(TestcaseBase):
del_res
=
collection_w
.
delete
(
tmp_expr
)[
0
]
assert
del_res
.
delete_count
==
1
# query id 0
time
.
sleep
(
1
)
collection_w
.
query
(
tmp_expr
,
check_task
=
CheckTasks
.
check_query_empty
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L1
)
def
test_delete_
after_load_sealed_segment
(
self
):
def
test_delete_
sealed_data_channel_delete
(
self
):
"""
target: test delete sealed data and get deleteMsg from insertChannel
method: 1.create, insert and flush data
...
...
@@ -596,7 +590,6 @@ class TestDeleteOperation(TestcaseBase):
# delete ids and query
collection_w
.
delete
(
tmp_expr
)
time
.
sleep
(
1
)
collection_w
.
query
(
tmp_expr
,
check_task
=
CheckTasks
.
check_query_empty
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L1
)
...
...
@@ -616,9 +609,12 @@ class TestDeleteOperation(TestcaseBase):
collection_w
.
insert
(
df
)
# assert collection_w.num_entities == tmp_nb
# delete id 0
and flush
# delete id 0
del_res
=
collection_w
.
delete
(
tmp_expr
)[
0
]
assert
del_res
.
delete_count
==
1
# insert data and flush data and delete ids.
# if no insert, datanode will not really flush delete ids
collection_w
.
insert
(
cf
.
gen_default_dataframe_data
(
nb
=
1
,
start
=
tmp_nb
))
log
.
info
(
f
'Collection num entities:
{
collection_w
.
num_entities
}
'
)
...
...
@@ -654,11 +650,11 @@ class TestDeleteOperation(TestcaseBase):
collection_w
.
query
(
tmp_expr
,
check_task
=
CheckTasks
.
check_query_empty
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L1
)
def
test_delete_sealed_
only
(
self
):
def
test_delete_sealed_
data_sealed_delete
(
self
):
"""
target: test delete with sealed
only data an
d delete request
target: test delete with sealed
data and seale
d delete request
method: 1.create, insert
2.delete and flush
2.delete and flush
(will flush data and delete)
3.load and query
expected: Empty query result
"""
...
...
@@ -696,7 +692,6 @@ class TestDeleteOperation(TestcaseBase):
del_res
,
_
=
collection_w
.
delete
(
tmp_expr
)
assert
del_res
.
delete_count
==
1
# assert collection_w.num_entities == tmp_nb
time
.
sleep
(
1
)
collection_w
.
query
(
tmp_expr
,
check_task
=
CheckTasks
.
check_query_empty
)
# insert entity with primary key 0
...
...
@@ -704,10 +699,8 @@ class TestDeleteOperation(TestcaseBase):
# query entity one
res
=
df
.
iloc
[
0
:
1
,
:
1
].
to_dict
(
'records'
)
time
.
sleep
(
1
)
collection_w
.
query
(
tmp_expr
,
check_task
=
CheckTasks
.
check_query_results
,
check_items
=
{
'exp_res'
:
res
})
@
pytest
.
mark
.
xfail
(
reason
=
"Issue: #10682"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_delete_entity_loop
(
self
):
"""
...
...
@@ -725,10 +718,8 @@ class TestDeleteOperation(TestcaseBase):
# query with all ids
expr
=
f
'
{
ct
.
default_int64_field_name
}
in
{
ids
}
'
time
.
sleep
(
10
)
collection_w
.
query
(
expr
,
check_task
=
CheckTasks
.
check_query_empty
)
@
pytest
.
mark
.
xfail
(
reason
=
"Issue: #10682"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_delete_flush_loop
(
self
):
"""
...
...
@@ -748,7 +739,6 @@ class TestDeleteOperation(TestcaseBase):
# query with all ids
expr
=
f
'
{
ct
.
default_int64_field_name
}
in
{
ids
}
'
time
.
sleep
(
1
)
collection_w
.
query
(
expr
,
check_task
=
CheckTasks
.
check_query_empty
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
...
...
@@ -809,7 +799,6 @@ class TestDeleteOperation(TestcaseBase):
# delete id 1 and query id 0 and 1
collection_w
.
delete
(
expr
=
f
'
{
ct
.
default_int64_field_name
}
in
{
[
1
]
}
'
)
time
.
sleep
(
1
)
collection_w
.
query
(
expr
=
f
'
{
ct
.
default_int64_field_name
}
in
{
[
0
,
1
]
}
'
,
check_task
=
CheckTasks
.
check_query_empty
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录