diff --git a/tests/python_client/testcases/test_collection.py b/tests/python_client/testcases/test_collection.py index 50498846c397..b4a0c2260290 100644 --- a/tests/python_client/testcases/test_collection.py +++ b/tests/python_client/testcases/test_collection.py @@ -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 @@ -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): """