Skip to content

Commit

Permalink
[skip ci] Add delete sealed only case (milvus-io#11858)
Browse files Browse the repository at this point in the history
Signed-off-by: ThreadDao <[email protected]>
  • Loading branch information
ThreadDao authored Nov 15, 2021
1 parent cf9ab64 commit 49a639d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/python_client/testcases/test_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,3 +859,33 @@ def test_delete_multi_threading(self):
expected: delete successfully
"""
pass

@pytest.mark.tags(CaseLabel.L3)
def test_delete_sealed_only(self):
"""
target: test delete sealed-only
method: 1.deploy sealed-only: two dmlChannel and three queryNodes
2.create and insert with flush
3.load
4.delete all data
5.query
expected:
"""
# init collection and insert data without flush
collection_w = self.init_collection_wrap(name=cf.gen_unique_str(prefix), shards_num=2)
# insert 3000 entities into 3 segments
segment_num = 3
segment_per_count = 2000
ids = []
for i in range(segment_num):
df = cf.gen_default_dataframe_data(nb=segment_per_count, start=(i * segment_per_count))
res, _ = collection_w.insert(df)
assert collection_w.num_entities == (i+1) * segment_per_count
ids.extend(res.primary_keys)

collection_w.load()

expr = f'{ct.default_int64_field_name} in {ids}'
collection_w.delete(expr)

collection_w.query(expr, check_task=CheckTasks.check_query_empty)

0 comments on commit 49a639d

Please sign in to comment.