diff --git a/tests/python_client/milvus_client/test_milvus_client_search.py b/tests/python_client/milvus_client/test_milvus_client_search.py index 549d0936e0..713840fc1e 100644 --- a/tests/python_client/milvus_client/test_milvus_client_search.py +++ b/tests/python_client/milvus_client/test_milvus_client_search.py @@ -124,7 +124,7 @@ class TestMilvusClientSearchInvalid(TestcaseBase): client = self._connect(enable_milvus_client_api=True) collection_name = cf.gen_unique_str(prefix) # 1. create collection - error = {ct.err_code: 65535, + error = {ct.err_code: 1100, ct.err_msg: "metric type not found or not supported, supported: [L2 IP COSINE HAMMING JACCARD]"} client_w.create_collection(client, collection_name, default_dim, metric_type="invalid", check_task=CheckTasks.err_res, check_items=error) diff --git a/tests/python_client/requirements.txt b/tests/python_client/requirements.txt index 81808e0a29..53dc601076 100644 --- a/tests/python_client/requirements.txt +++ b/tests/python_client/requirements.txt @@ -12,7 +12,7 @@ allure-pytest==2.7.0 pytest-print==0.2.1 pytest-level==0.1.1 pytest-xdist==2.5.0 -pymilvus==2.5.0rc3 +pymilvus==2.5.0rc4 pytest-rerunfailures==9.1.1 git+https://github.com/Projectplace/pytest-tags ndg-httpsclient diff --git a/tests/python_client/testcases/test_collection.py b/tests/python_client/testcases/test_collection.py index 5de94435a2..c64130b2f4 100644 --- a/tests/python_client/testcases/test_collection.py +++ b/tests/python_client/testcases/test_collection.py @@ -1190,7 +1190,7 @@ class TestCollectionOperation(TestcaseBase): self.connection_wrap.remove_connection(ct.default_alias) res_list, _ = self.connection_wrap.list_connections() assert ct.default_alias not in res_list - error = {ct.err_code: 0, ct.err_msg: 'should create connect first'} + error = {ct.err_code: 1, ct.err_msg: 'should create connect first'} self.collection_wrap.init_collection(c_name, schema=default_schema, check_task=CheckTasks.err_res, check_items=error) assert self.collection_wrap.collection is None @@ -2075,7 +2075,7 @@ class TestDropCollection(TestcaseBase): self.connection_wrap.remove_connection(ct.default_alias) res_list, _ = self.connection_wrap.list_connections() assert ct.default_alias not in res_list - error = {ct.err_code: 0, ct.err_msg: 'should create connect first'} + error = {ct.err_code: 1, ct.err_msg: 'should create connect first'} collection_wr.drop(check_task=CheckTasks.err_res, check_items=error) @pytest.mark.tags(CaseLabel.L1) @@ -2176,7 +2176,7 @@ class TestHasCollection(TestcaseBase): self.connection_wrap.remove_connection(ct.default_alias) res_list, _ = self.connection_wrap.list_connections() assert ct.default_alias not in res_list - error = {ct.err_code: 0, ct.err_msg: 'should create connect first'} + error = {ct.err_code: 1, ct.err_msg: 'should create connect first'} self.utility_wrap.has_collection(c_name, check_task=CheckTasks.err_res, check_items=error) @pytest.mark.tags(CaseLabel.L2) @@ -2291,7 +2291,7 @@ class TestListCollections(TestcaseBase): self.connection_wrap.remove_connection(ct.default_alias) res_list, _ = self.connection_wrap.list_connections() assert ct.default_alias not in res_list - error = {ct.err_code: 0, ct.err_msg: 'should create connect first'} + error = {ct.err_code: 1, ct.err_msg: 'should create connect first'} self.utility_wrap.list_collections(check_task=CheckTasks.err_res, check_items=error) @pytest.mark.tags(CaseLabel.L2) @@ -2384,7 +2384,7 @@ class TestLoadCollection(TestcaseBase): self.connection_wrap.remove_connection(ct.default_alias) res_list, _ = self.connection_wrap.list_connections() assert ct.default_alias not in res_list - error = {ct.err_code: 0, ct.err_msg: 'should create connect first'} + error = {ct.err_code: 1, ct.err_msg: 'should create connect first'} collection_wr.load(check_task=CheckTasks.err_res, check_items=error) @pytest.mark.tags(CaseLabel.L2) @@ -2400,7 +2400,7 @@ class TestLoadCollection(TestcaseBase): self.connection_wrap.remove_connection(ct.default_alias) res_list, _ = self.connection_wrap.list_connections() assert ct.default_alias not in res_list - error = {ct.err_code: 0, ct.err_msg: 'should create connect first'} + error = {ct.err_code: 1, ct.err_msg: 'should create connect first'} collection_wr.release(check_task=CheckTasks.err_res, check_items=error) @pytest.mark.tags(CaseLabel.L2) @@ -3413,7 +3413,7 @@ class TestLoadPartition(TestcaseBase): self.connection_wrap.remove_connection(ct.default_alias) res_list, _ = self.connection_wrap.list_connections() assert ct.default_alias not in res_list - error = {ct.err_code: 0, ct.err_msg: 'should create connect first.'} + error = {ct.err_code: 1, ct.err_msg: 'should create connect first.'} partition_w.load(check_task=CheckTasks.err_res, check_items=error) @pytest.mark.tags(CaseLabel.L2) @@ -3438,7 +3438,7 @@ class TestLoadPartition(TestcaseBase): self.connection_wrap.remove_connection(ct.default_alias) res_list, _ = self.connection_wrap.list_connections() assert ct.default_alias not in res_list - error = {ct.err_code: 0, ct.err_msg: 'should create connect first.'} + error = {ct.err_code: 1, ct.err_msg: 'should create connect first.'} partition_w.release(check_task=CheckTasks.err_res, check_items=error) @pytest.mark.tags(CaseLabel.L2) diff --git a/tests/python_client/testcases/test_compaction.py b/tests/python_client/testcases/test_compaction.py index 88ef2debb0..6b87481ea7 100644 --- a/tests/python_client/testcases/test_compaction.py +++ b/tests/python_client/testcases/test_compaction.py @@ -31,7 +31,7 @@ class TestCompactionParams(TestcaseBase): self.connection_wrap.remove_connection(ct.default_alias) res_list, _ = self.connection_wrap.list_connections() assert ct.default_alias not in res_list - error = {ct.err_code: 0, ct.err_msg: "should create connect first"} + error = {ct.err_code: 1, ct.err_msg: "should create connect first"} collection_w.compact(check_task=CheckTasks.err_res, check_items=error) @pytest.mark.tags(CaseLabel.L1) diff --git a/tests/python_client/testcases/test_delete.py b/tests/python_client/testcases/test_delete.py index b589aa38b8..56646ceb94 100644 --- a/tests/python_client/testcases/test_delete.py +++ b/tests/python_client/testcases/test_delete.py @@ -95,7 +95,7 @@ class TestDeleteParams(TestcaseBase): self.connection_wrap.remove_connection(ct.default_alias) res_list, _ = self.connection_wrap.list_connections() assert ct.default_alias not in res_list - error = {ct.err_code: 0, ct.err_msg: "should create connect first"} + error = {ct.err_code: 1, ct.err_msg: "should create connect first"} collection_w.delete(expr=tmp_expr, check_task=CheckTasks.err_res, check_items=error) # Not Milvus Exception diff --git a/tests/python_client/testcases/test_index.py b/tests/python_client/testcases/test_index.py index b37e327bf0..fe40519baa 100644 --- a/tests/python_client/testcases/test_index.py +++ b/tests/python_client/testcases/test_index.py @@ -1020,7 +1020,7 @@ class TestNewIndexBase(TestcaseBase): index_name=ct.default_index_name) self.connection_wrap.remove_connection(ct.default_alias) collection_w.drop_index(index_name=ct.default_index_name, check_task=CheckTasks.err_res, - check_items={ct.err_code: 0, ct.err_msg: "should create connect first."}) + check_items={ct.err_code: 1, ct.err_msg: "should create connect first."}) @pytest.mark.tags(CaseLabel.L2) def test_create_drop_index_repeatedly_ip(self, get_simple_index): @@ -1286,8 +1286,12 @@ class TestNewIndexBinary(TestcaseBase): c_name = cf.gen_unique_str(prefix) collection_w = self.init_collection_wrap(name=c_name, schema=default_binary_schema) binary_index_params = {'index_type': 'HNSW', "M": '18', "efConstruction": '240', 'metric_type': metric_type} - collection_w.create_index(default_binary_vec_field_name, binary_index_params) - assert collection_w.index()[0].params == binary_index_params + collection_w.create_index(default_binary_vec_field_name, binary_index_params, + check_task=CheckTasks.err_res, + check_items={ct.err_code: 1100, + ct.err_msg: "HNSW only support float vector data type: invalid " + "parameter[expected=valid index params][actual=invalid " + "index params]"}) @pytest.mark.tags(CaseLabel.L2) @pytest.mark.parametrize("metric", ct.binary_metrics) @@ -2299,9 +2303,12 @@ class TestAutoIndex(TestcaseBase): expected: raise exception """ collection_w = self.init_collection_general(prefix, is_binary=True, is_index=False)[0] - collection_w.create_index(binary_field_name, {}) - actual_index_params = collection_w.index()[0].params - assert default_autoindex_params == actual_index_params + collection_w.create_index(binary_field_name, {}, + check_task=CheckTasks.err_res, + check_items={ct.err_code: 1100, + ct.err_msg: "HNSW only support float vector data type: invalid " + "parameter[expected=valid index params][actual=invalid " + "index params]"}) @pytest.mark.tags(CaseLabel.GPU) diff --git a/tests/python_client/testcases/test_insert.py b/tests/python_client/testcases/test_insert.py index ca902d49de..088d597cfd 100644 --- a/tests/python_client/testcases/test_insert.py +++ b/tests/python_client/testcases/test_insert.py @@ -466,9 +466,8 @@ class TestInsertOperation(TestcaseBase): res_list, _ = self.connection_wrap.list_connections() assert ct.default_alias not in res_list data = cf.gen_default_list_data(10) - error = {ct.err_code: 0, ct.err_msg: 'should create connect first'} - collection_w.insert( - data=data, check_task=CheckTasks.err_res, check_items=error) + error = {ct.err_code: 1, ct.err_msg: 'should create connect first'} + collection_w.insert(data=data, check_task=CheckTasks.err_res, check_items=error) @pytest.mark.tags(CaseLabel.L1) def test_insert_default_partition(self): diff --git a/tests/python_client/testcases/test_search.py b/tests/python_client/testcases/test_search.py index 52ef7cb844..056ea6ef0f 100644 --- a/tests/python_client/testcases/test_search.py +++ b/tests/python_client/testcases/test_search.py @@ -2216,6 +2216,7 @@ class TestCollectionSearch(TestcaseBase): @pytest.mark.tags(CaseLabel.L2) @pytest.mark.tags(CaseLabel.GPU) + @pytest.mark.skip("https://github.com/milvus-io/milvus/issues/31958") @pytest.mark.parametrize("index, params", zip(ct.all_index_types[:7], ct.default_index_params[:7])) @@ -3165,6 +3166,7 @@ class TestCollectionSearch(TestcaseBase): assert set(ids).issubset(filter_ids_set) @pytest.mark.tags(CaseLabel.L2) + @pytest.mark.skip("https://github.com/milvus-io/milvus/issues/31958") @pytest.mark.parametrize("bool_type", [True, False, "true", "false"]) def test_search_with_expression_bool(self, dim, auto_id, _async, bool_type, enable_dynamic_field): """ @@ -3395,7 +3397,6 @@ class TestCollectionSearch(TestcaseBase): is_all_data_type=True, auto_id=auto_id, dim=dim, - enable_dynamic_field=enable_dynamic_field, multiple_dim_array=[dim, dim])[0:4] # 2. search log.info("test_search_expression_all_data_type: Searching collection %s" % @@ -4630,7 +4631,7 @@ class TestCollectionSearch(TestcaseBase): @pytest.mark.tags(CaseLabel.L2) @pytest.mark.parametrize("metrics", ct.binary_metrics[:2]) - @pytest.mark.parametrize("index", ["BIN_FLAT", "BIN_IVF_FLAT", "HNSW"]) + @pytest.mark.parametrize("index", ["BIN_FLAT", "BIN_IVF_FLAT"]) @pytest.mark.parametrize("dim", [32768, 65536, ct.max_binary_vector_dim-8, ct.max_binary_vector_dim]) def test_binary_indexed_large_dim_vectors_search(self, metrics, index, dim): """