Skip to content

Commit

Permalink
modify error code nightly cases (#27788)
Browse files Browse the repository at this point in the history
Signed-off-by: nico <[email protected]>
  • Loading branch information
NicoYuan1986 authored Oct 23, 2023
1 parent d2dbbbc commit 6b33420
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 122 deletions.
63 changes: 17 additions & 46 deletions tests/python_client/testcases/test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2439,12 +2439,7 @@ def test_load_collection_after_release_partition_collection(self):
self.init_partition_wrap(collection_w, partition2)
collection_w.load()
partition_w.release()
error = {ct.err_code: 65538,
ct.err_msg: 'failed to query: attempt #0: failed to search/query delegator 1'
' for channel by-dev-rootcoord-dml_0_444857573607352620v0: fail '
'to Query, QueryNode ID = 1, reason=partition=[444857573607352660]:'
' partition not loaded: attempt #1: no available shard delegator '
'found: service unavailable'}
error = {ct.err_code: 65538, ct.err_msg: 'partition not loaded'}
collection_w.query(default_term_expr, partition_names=[partition1],
check_task=CheckTasks.err_res, check_items=error)
collection_w.release()
Expand All @@ -2469,12 +2464,7 @@ def test_load_partitions_after_release_partition_collection(self):
partition_w1.release()
collection_w.release()
partition_w1.load()
error = {ct.err_code: 65538,
ct.err_msg: 'failed to query: attempt #0: failed to search/query delegator '
'1 for channel by-dev-rootcoord-dml_14_444857573607352608v0: fail'
' to Query, QueryNode ID = 1, reason=partition=[444857573607352653]:'
' partition not loaded: attempt #1: no available shard delegator '
'found: service unavailable'}
error = {ct.err_code: 65538, ct.err_msg: 'partition not loaded'}
collection_w.query(default_term_expr, partition_names=[partition2],
check_task=CheckTasks.err_res, check_items=error)
partition_w2.load()
Expand Down Expand Up @@ -2532,10 +2522,7 @@ def test_load_collection_after_drop_partition_and_release_another(self):
partition_w1.release()
partition_w1.drop()
partition_w2.release()
error = {ct.err_code: 65538, ct.err_msg: 'failed to query: attempt #0: failed to search/query delegator 1 '
'for channel by-dev-rootcoord-xx: fail to Query, QueryNode ID = 1,'
' reason=partition=[ ]: partition not loaded: attempt #1: no '
'available shard delegator found: service unavailable'}
error = {ct.err_code: 65538, ct.err_msg: 'partition not loaded'}
collection_w.query(default_term_expr, partition_names=[partition2],
check_task=CheckTasks.err_res, check_items=error)
collection_w.load()
Expand Down Expand Up @@ -2614,8 +2601,7 @@ def test_load_release_collection(self):
collection_wr.load()
collection_wr.release()
collection_wr.drop()
error = {ct.err_code: 100,
ct.err_msg: "collection=444857573607352784: collection not found"}
error = {ct.err_code: 100, ct.err_msg: "collection not found"}
collection_wr.load(check_task=CheckTasks.err_res, check_items=error)
collection_wr.release(check_task=CheckTasks.err_res, check_items=error)

Expand All @@ -2632,8 +2618,7 @@ def test_release_collection_after_drop(self):
collection_wr.create_index(ct.default_float_vec_field_name, index_params=ct.default_flat_index)
collection_wr.load()
collection_wr.drop()
error = {ct.err_code: 100,
ct.err_msg: "collection=444857573607351711: collection not found"}
error = {ct.err_code: 100, ct.err_msg: "collection not found"}
collection_wr.release(check_task=CheckTasks.err_res, check_items=error)

@pytest.mark.tags(CaseLabel.L1)
Expand Down Expand Up @@ -2776,7 +2761,8 @@ def test_load_replica_change(self):
assert loading_progress == {'loading_progress': '100%'}

# verify load different replicas thrown an exception
error = {ct.err_code: 5, ct.err_msg: f"Should release first then reload with the new number of replicas"}
error = {ct.err_code: 1100, ct.err_msg: "failed to load collection: can't change the replica number for "
"loaded collection: expected=1, actual=2: invalid parameter"}
collection_w.load(replica_number=2, check_task=CheckTasks.err_res, check_items=error)
one_replica, _ = collection_w.get_replicas()
assert len(one_replica.groups) == 1
Expand Down Expand Up @@ -2862,7 +2848,7 @@ def test_load_replica_partitions(self):
check_task=CheckTasks.check_query_results,
check_items={'exp_res': df_2.iloc[:1, :1].to_dict('records')})

error = {ct.err_code: 1, ct.err_msg: f"not loaded into memory"}
error = {ct.err_code: 65538, ct.err_msg: "partition not loaded"}
collection_w.query(expr=f"{ct.default_int64_field_name} in [0]",
partition_names=[ct.default_partition_name, ct.default_tag],
check_task=CheckTasks.err_res, check_items=error)
Expand Down Expand Up @@ -3016,7 +3002,7 @@ def test_get_collection_replicas_not_loaded(self):
collection_w.get_replicas(check_task=CheckTasks.err_res,
check_items={"err_code": 400,
"err_msg": "failed to get replicas by collection: "
"replica=444857573607352187: replica not found"})
"replica not found"})

@pytest.mark.tags(CaseLabel.L3)
def test_count_multi_replicas(self):
Expand Down Expand Up @@ -3113,9 +3099,7 @@ def test_release_collection_during_searching(self):
search_res, _ = collection_wr.search(vectors, default_search_field, default_search_params,
default_limit, _async=True)
collection_wr.release()
error = {ct.err_code: 65535, ct.err_msg: "failed to search: attempt #0: fail to get shard leaders from"
" QueryCoord: collection=444818512783071471: collection not"
" loaded: unrecoverable error"}
error = {ct.err_code: 65535, ct.err_msg: "collection not loaded"}
collection_wr.search(vectors, default_search_field, default_search_params, default_limit,
check_task=CheckTasks.err_res, check_items=error)

Expand Down Expand Up @@ -3143,9 +3127,7 @@ def test_release_partition_during_searching(self):
[par_name],
check_task=CheckTasks.err_res,
check_items={"err_code": 65535,
"err_msg": "failed to search: attempt #0: fail to get shard leaders "
"from QueryCoord: collection=444857573607353390: collection "
"not loaded: unrecoverable error"})
"err_msg": "collection not loaded"})

@pytest.mark.tags(CaseLabel.L0)
def test_release_indexed_collection_during_searching(self):
Expand All @@ -3166,9 +3148,7 @@ def test_release_indexed_collection_during_searching(self):
default_search_params, limit, default_search_exp,
[par_name], _async=True)
collection_w.release()
error = {ct.err_code: 65535, ct.err_msg: "failed to search: attempt #0: fail to get shard leaders from "
"QueryCoord: collection=444818512783071824: collection not "
"loaded: unrecoverable error"}
error = {ct.err_code: 65535, ct.err_msg: "collection not loaded"}
collection_w.search(vectors, default_search_field,
default_search_params, limit, default_search_exp,
[par_name],
Expand Down Expand Up @@ -3401,10 +3381,7 @@ def test_load_collection_after_load_loaded_partition(self):
partition_w1.load()
partition_w1.load()
error = {ct.err_code: 65538,
ct.err_msg: 'failed to query: attempt #0: failed to search/query delegator 1 for'
' channel by-dev-rootcoord-dml_10_444857573607353001v0: fail to Query, '
'QueryNode ID = 1, reason=partition=[444857573607353015]: partition not '
'loaded: attempt #1: no available shard delegator found: service unavailable'}
ct.err_msg: 'partition not loaded'}
collection_w.query(default_term_expr, partition_names=[partition2],
check_task=CheckTasks.err_res, check_items=error)
collection_w.load()
Expand Down Expand Up @@ -3459,9 +3436,7 @@ def test_load_partitions_release_collection(self):
partition_w2 = self.init_partition_wrap(collection_w, partition2)
partition_w1.load()
collection_w.release()
error = {ct.err_code: 65535, ct.err_msg: "failed to query: attempt #0: fail to get shard leaders from "
"QueryCoord: collection=444818512783073123: collection not"
" loaded: unrecoverable error"}
error = {ct.err_code: 65535, ct.err_msg: "collection not loaded"}
collection_w.query(default_term_expr, partition_names=[partition1],
check_task=CheckTasks.err_res, check_items=error)
partition_w1.load()
Expand Down Expand Up @@ -3501,8 +3476,7 @@ def test_load_partitions_after_load_release_partition(self):
partition_w1.load()
partition_w1.release()
error = {ct.err_code: 65535,
ct.err_msg: 'failed to query: attempt #0: fail to get shard leaders from QueryCoord: '
'collection=444857573607352292: collection not loaded: unrecoverable error'}
ct.err_msg: 'collection not loaded'}
collection_w.query(default_term_expr, partition_names=[partition1],
check_task=CheckTasks.err_res, check_items=error)
partition_w1.load()
Expand Down Expand Up @@ -3566,8 +3540,7 @@ def test_load_collection_after_load_partition_release_partitions(self):
partition_w1.release()
partition_w2.release()
error = {ct.err_code: 65535,
ct.err_msg: 'failed to query: attempt #0: fail to get shard leaders from QueryCoord:'
' collection=444857573607353795: collection not loaded: unrecoverable error'}
ct.err_msg: 'collection not loaded'}
collection_w.query(default_term_expr, partition_names=[partition1, partition2],
check_task=CheckTasks.err_res, check_items=error)
collection_w.load()
Expand Down Expand Up @@ -3694,9 +3667,7 @@ def test_release_load_partition_after_load_partition_drop_another(self):
partition_w2.drop()
partition_w1.release()
error = {ct.err_code: 65535,
ct.err_msg: 'failed to query: attempt #0: fail to get shard leaders from'
' QueryCoord: collection=444857573607353891: collection not'
' loaded: unrecoverable error'}
ct.err_msg: 'collection not loaded'}
collection_w.query(default_term_expr, partition_names=[partition1],
check_task=CheckTasks.err_res, check_items=error)
partition_w1.load()
Expand Down
4 changes: 1 addition & 3 deletions tests/python_client/testcases/test_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,9 +678,7 @@ def test_delete_query_without_loading(self):
assert res.delete_count == 1

# query without loading and raise exception
error = {ct.err_code: 65535,
ct.err_msg: "failed to query: attempt #0: fail to get shard leaders from QueryCoord:"
" collection=444857573607556205: collection not loaded: unrecoverable error"}
error = {ct.err_code: 65535, ct.err_msg: "collection not loaded"}
collection_w.query(expr=tmp_expr, check_task=CheckTasks.err_res, check_items=error)

@pytest.mark.tags(CaseLabel.L1)
Expand Down
7 changes: 3 additions & 4 deletions tests/python_client/testcases/test_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@ def test_load_replica_change(self):
partition_w.load(replica_number=1)
collection_w.query(expr=f"{ct.default_int64_field_name} in [0]", check_task=CheckTasks.check_query_results,
check_items={'exp_res': [{'int64': 0}]})
error = {ct.err_code: 5, ct.err_msg: f"Should release first then reload with the new number of replicas"}
error = {ct.err_code: 1100, ct.err_msg: "failed to load partitions: can't change the replica number for "
"loaded partitions: expected=1, actual=2: invalid parameter"}
partition_w.load(replica_number=2, check_task=CheckTasks.err_res, check_items=error)

partition_w.release()
Expand Down Expand Up @@ -506,9 +507,7 @@ def test_partition_release(self):
params={"nprobe": 32}, limit=1,
check_task=ct.CheckTasks.err_res,
check_items={ct.err_code: 65535,
ct.err_msg: "failed to search: attempt #0: fail to get shard "
"leaders from QueryCoord: collection=4448185127832"
"79866: collection not loaded: unrecoverable error"})
ct.err_msg: "collection not loaded"})

@pytest.mark.tags(CaseLabel.L1)
@pytest.mark.parametrize("data", [cf.gen_default_dataframe_data(10),
Expand Down
12 changes: 3 additions & 9 deletions tests/python_client/testcases/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -1509,9 +1509,7 @@ def test_query_partition_without_loading(self):
df = cf.gen_default_dataframe_data()
partition_w.insert(df)
assert partition_w.num_entities == ct.default_nb
error = {ct.err_code: 65535, ct.err_msg: "failed to query: attempt #0: fail to get shard leaders from "
"QueryCoord: collection=444857573608181561: collection"
" not loaded: unrecoverable error"}
error = {ct.err_code: 65535, ct.err_msg: "collection not loaded"}
collection_w.query(default_term_expr, partition_names=[partition_w.name],
check_task=CheckTasks.err_res, check_items=error)

Expand Down Expand Up @@ -1941,9 +1939,7 @@ def test_query_without_loading(self):
# query without load
collection_w.query(default_term_expr, check_task=CheckTasks.err_res,
check_items={ct.err_code: 65535,
ct.err_msg: "failed to query: attempt #0: fail to get shard leaders"
" from QueryCoord: collection=444857573609193909: "
"collection not loaded: unrecoverable error"})
ct.err_msg: "collection not loaded"})

@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.parametrize("term_expr", [f'{ct.default_int64_field_name} in [0]'])
Expand Down Expand Up @@ -2680,9 +2676,7 @@ def test_count_without_loading(self):
collection_w.query(expr=default_term_expr, output_fields=[ct.default_count_output],
check_task=CheckTasks.err_res,
check_items={"err_code": 65535,
"err_msg": "failed to query: attempt #0: fail to get shard leaders from "
"QueryCoord: collection=444857573609396129: collection not loaded:"
" unrecoverable error"})
"err_msg": "collection not loaded"})

@pytest.mark.tags(CaseLabel.L1)
def test_count_duplicate_ids(self):
Expand Down
Loading

0 comments on commit 6b33420

Please sign in to comment.