Skip to content

Commit

Permalink
Add test case of drop collection during insert (#25131)
Browse files Browse the repository at this point in the history
Signed-off-by: nico <cheng.yuan@zilliz.com>
  • Loading branch information
NicoYuan1986 committed Jul 17, 2023
1 parent f43ad14 commit e4bdde6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/python_client/testcases/test_collection.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy
import pandas as pd
import pytest
import threading

from base.client_base import TestcaseBase
from common import common_func as cf
Expand Down Expand Up @@ -1795,6 +1796,30 @@ def create():
for item in collection_names:
assert not self.utility_wrap.has_collection(item)[0]

@pytest.mark.tags(CaseLabel.L2)
def test_drop_collection_during_insert(self):
"""
target: test drop collection during insert
method: drop collection during insert
expected: drop successfully
"""
self._connect()
c_name = cf.gen_unique_str(prefix)
collection_w = self.init_collection_wrap(c_name)
data = cf.gen_default_dataframe_data()

def insert():
collection_w.insert(data)

t = threading.Thread(target=insert, args=())

t.start()
collection_w.drop()
t.join()

collection_list = self.utility_wrap.list_collections()[0]
assert c_name not in collection_list


class TestDropCollectionInvalid(TestcaseBase):
"""
Expand Down

0 comments on commit e4bdde6

Please sign in to comment.