mirror of https://github.com/milvus-io/milvus.git
Add test cases of the new rules of index (#19933)
Signed-off-by: nico <cheng.yuan@zilliz.com> Signed-off-by: nico <cheng.yuan@zilliz.com>pull/19969/head
parent
41483945be
commit
4a6880af78
|
@ -2537,6 +2537,18 @@ class TestLoadCollection(TestcaseBase):
|
|||
check_items={"err_code": 15,
|
||||
"err_msg": "collection not found, maybe not loaded"})
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L1)
|
||||
def test_load_collection_without_creating_index(self):
|
||||
"""
|
||||
target: test drop index after load without release
|
||||
method: create a collection without index, then load
|
||||
expected: raise exception
|
||||
"""
|
||||
collection_w = self.init_collection_general(prefix, True, is_index=True)[0]
|
||||
collection_w.load(check_task=CheckTasks.err_res,
|
||||
check_items={"err_code": 1,
|
||||
"err_msg": "index not exist"})
|
||||
|
||||
|
||||
class TestReleaseAdvanced(TestcaseBase):
|
||||
@pytest.mark.tags(CaseLabel.L0)
|
||||
|
|
|
@ -1169,7 +1169,7 @@ class TestNewIndexBinary(TestcaseBase):
|
|||
assert len(collection_w.indexes) == 0
|
||||
|
||||
|
||||
class TestIndexInvalid(object):
|
||||
class TestIndexInvalid(TestcaseBase):
|
||||
"""
|
||||
Test create / describe / drop index interfaces with invalid collection names
|
||||
"""
|
||||
|
@ -1221,6 +1221,23 @@ class TestIndexInvalid(object):
|
|||
with pytest.raises(Exception) as e:
|
||||
connect.create_index(collection, field_name, get_index)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L1)
|
||||
def test_drop_index_without_release(self):
|
||||
"""
|
||||
target: test drop index after load without release
|
||||
method: 1. create a collection and build an index then load
|
||||
2. drop the index
|
||||
expected: raise exception
|
||||
"""
|
||||
collection_w = self.init_collection_general(prefix, True, is_index=True)[0]
|
||||
default_index = {"index_type": "IVF_FLAT", "params": {"nlist": 128}, "metric_type": "L2"}
|
||||
collection_w.create_index("float_vector", default_index)
|
||||
collection_w.load()
|
||||
collection_w.drop_index(check_task=CheckTasks.err_res,
|
||||
check_items={"err_code": 1,
|
||||
"err_msg": "index cannot be dropped, collection is "
|
||||
"loaded, please release it first"})
|
||||
|
||||
|
||||
class TestNewIndexAsync(TestcaseBase):
|
||||
@pytest.fixture(scope="function", params=[False, True])
|
||||
|
|
Loading…
Reference in New Issue