From c551b2bdfabb107bab7211e5317a7633134f5605 Mon Sep 17 00:00:00 2001 From: NicoYuan1986 <109071306+NicoYuan1986@users.noreply.github.com> Date: Mon, 17 Oct 2022 19:03:26 +0800 Subject: [PATCH] Modify cases associated with updated shard num (#19811) Signed-off-by: nico Signed-off-by: nico --- tests/python_client/testcases/test_collection.py | 8 ++++---- tests/python_client/testcases/test_search.py | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/python_client/testcases/test_collection.py b/tests/python_client/testcases/test_collection.py index 15ddbab110..fc39dbf8b7 100644 --- a/tests/python_client/testcases/test_collection.py +++ b/tests/python_client/testcases/test_collection.py @@ -921,7 +921,7 @@ class TestCollectionParams(TestcaseBase): assert c_name in self.utility_wrap.list_collections()[0] @pytest.mark.tags(CaseLabel.L2) - @pytest.mark.parametrize("shards_num", [-256, 0, 1, 10, 214, 256]) + @pytest.mark.parametrize("shards_num", [-256, 0, 1, 10, 31, 63]) def test_collection_shards_num_with_not_default_value(self, shards_num): """ target:test collection with shards_num @@ -936,16 +936,16 @@ class TestCollectionParams(TestcaseBase): assert c_name in self.utility_wrap.list_collections()[0] @pytest.mark.tags(CaseLabel.L2) - @pytest.mark.parametrize("shards_num", [257]) + @pytest.mark.parametrize("shards_num", [65, 257]) def test_collection_shards_num_invalid(self, shards_num): """ target:test collection with invalid shards_num - method:create collection with shards_num out of [1,256] + method:create collection with shards_num out of [1,64] expected: raise exception """ self._connect() c_name = cf.gen_unique_str(prefix) - error = {ct.err_code: 1, ct.err_msg: "maximum shards's number should be limited to 256"} + error = {ct.err_code: 1, ct.err_msg: "shard num (%s) exceeds limit (64)" % shards_num} self.collection_wrap.init_collection(c_name, schema=default_schema, shards_num=shards_num, check_task=CheckTasks.err_res, check_items=error) diff --git a/tests/python_client/testcases/test_search.py b/tests/python_client/testcases/test_search.py index 0118942f2c..8d5b8ef01d 100644 --- a/tests/python_client/testcases/test_search.py +++ b/tests/python_client/testcases/test_search.py @@ -1385,9 +1385,8 @@ class TestCollectionSearch(TestcaseBase): "limit": default_limit, "_async": _async}) - @pytest.mark.xfail(reason="issue #19130") @pytest.mark.tags(CaseLabel.L2) - @pytest.mark.parametrize("shards_num", [1, 10, 128, 256]) + @pytest.mark.parametrize("shards_num", [-256, 0, 1, 10, 31, 63]) def test_search_with_non_default_shard_nums(self, auto_id, shards_num, _async): """ target: test search with non_default shards_num