Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
ffd31877
M
milvus
项目概览
milvus
/
milvus
10 个月 前同步成功
通知
260
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
ffd31877
编写于
12月 03, 2020
作者:
T
ThreadDao
提交者:
GitHub
12月 03, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add case for server crash when cycle delete entities across segments (#4355)
上级
1a206d24
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
58 addition
and
5 deletion
+58
-5
tests/milvus_python_test/entity/test_delete.py
tests/milvus_python_test/entity/test_delete.py
+58
-5
未找到文件。
tests/milvus_python_test/entity/test_delete.py
浏览文件 @
ffd31877
...
...
@@ -18,12 +18,14 @@ default_single_query = {
}
}
class
TestDeleteBase
:
"""
******************************************************************
The following cases are used to test `delete_entity_by_id` function
******************************************************************
"""
@
pytest
.
fixture
(
scope
=
"function"
,
params
=
gen_simple_index
()
...
...
@@ -141,7 +143,7 @@ class TestDeleteBase:
target: test delete entity
method: add one entity and delete two ids
expected: error raised
'''
'''
ids
=
connect
.
bulk_insert
(
collection
,
default_entity
)
connect
.
flush
([
collection
])
delete_ids
=
[
ids
[
0
],
1
]
...
...
@@ -313,6 +315,7 @@ class TestDeleteBase:
The following cases are used to test `delete_entity_by_id` function, with tags
******************************************************************
"""
def
test_insert_tag_delete
(
self
,
connect
,
collection
):
'''
method: add entitys with given tag, delete entities with the return ids
...
...
@@ -362,10 +365,10 @@ class TestDeleteBase:
assert
res_count
==
2
*
(
default_nb
-
1
)
def
test_insert_tags_index_delete
(
self
,
connect
,
collection
,
get_simple_index
):
'''
"""
method: add entitys with given tag, create index, delete entities with the return ids
expected: entities deleted
'''
"""
tag_new
=
"tag_new"
connect
.
create_partition
(
collection
,
default_tag
)
connect
.
create_partition
(
collection
,
tag_new
)
...
...
@@ -380,12 +383,63 @@ class TestDeleteBase:
res_count
=
connect
.
count_entities
(
collection
)
assert
res_count
==
2
*
(
default_nb
-
1
)
def
test_insert_delete_loop
(
self
,
connect
,
collection
):
"""
target: test loop insert and delete entities
method: loop insert entities into two segments, and delete entities cross segments.
expected: count is correct
"""
loop
=
2
for
i
in
range
(
loop
):
ids
=
connect
.
bulk_insert
(
collection
,
default_entities
)
connect
.
flush
([
collection
])
status
=
connect
.
delete_entity_by_id
(
collection
,
ids
[
100
:
default_nb
-
100
])
connect
.
flush
([
collection
])
res_count
=
connect
.
count_entities
(
collection
)
assert
res_count
==
loop
*
200
def
test_search_delete_loop
(
self
,
connect
,
collection
):
"""
target: test loop search and delete entities
method: loop search and delete cross segments
expected: ok
"""
loop
=
2
ids
=
connect
.
bulk_insert
(
collection
,
default_entities
)
connect
.
flush
([
collection
])
ni
=
default_nb
//
loop
for
i
in
range
(
loop
):
res
=
connect
.
search
(
collection
,
default_single_query
)
status
=
connect
.
delete_entity_by_id
(
collection
,
ids
[
i
*
ni
:(
i
+
1
)
*
ni
])
assert
status
connect
.
flush
([
collection
])
res_count
=
connect
.
count_entities
(
collection
)
assert
res_count
==
0
def
test_count_delete_loop
(
self
,
connect
,
collection
):
"""
target: test loop search and delete entities
method: loop search and delete cross segments
expected: ok
"""
loop
=
2
ids
=
connect
.
bulk_insert
(
collection
,
default_entities
)
connect
.
flush
([
collection
])
ni
=
default_nb
//
loop
for
i
in
range
(
loop
):
connect
.
count_entities
(
collection
)
status
=
connect
.
delete_entity_by_id
(
collection
,
ids
[
i
*
ni
:(
i
+
1
)
*
ni
])
assert
status
connect
.
flush
([
collection
])
res_count
=
connect
.
count_entities
(
collection
)
assert
res_count
==
0
class
TestDeleteInvalid
(
object
):
class
TestDeleteInvalid
(
object
):
"""
Test adding vectors with invalid vectors
"""
@
pytest
.
fixture
(
scope
=
"function"
,
params
=
gen_invalid_ints
()
...
...
@@ -416,4 +470,3 @@ class TestDeleteInvalid(object):
collection_name
=
get_collection_name
with
pytest
.
raises
(
Exception
)
as
e
:
status
=
connect
.
delete_entity_by_id
(
collection_name
,
[
1
])
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录