Skip to content

Commit

Permalink
test: fix unstable testcase caused by server refactor (#37545)
Browse files Browse the repository at this point in the history
issue: #37533

Signed-off-by: zhuwenxing <[email protected]>
  • Loading branch information
zhuwenxing authored Nov 9, 2024
1 parent 70605cf commit ffdde39
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/python_client/testcases/test_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,7 @@ def test_load_balance_with_one_sealed_segment_id_not_exist(self):
df = cf.gen_default_dataframe_data(nb)
collection_w.insert(df)
# get sealed segments
collection_w.num_entities
collection_w.flush()
# get growing segments
collection_w.insert(df)
collection_w.load()
Expand All @@ -1635,8 +1635,11 @@ def test_load_balance_with_one_sealed_segment_id_not_exist(self):
src_node_id = all_querynodes[0]
dst_node_ids = all_querynodes[1:]
sealed_segment_ids = segment_distribution[src_node_id]["sealed"]
# add a segment id which is not exist
sealed_segment_ids.append(max(segment_distribution[src_node_id]["sealed"]) + 1)
if len(segment_distribution[src_node_id]["sealed"]) == 0:
sealed_segment_ids = [0] # add a segment id which is not exist
else:
# add a segment id which is not exist
sealed_segment_ids.append(max(segment_distribution[src_node_id]["sealed"]) + 1)
# load balance
self.utility_wrap.load_balance(collection_w.name, src_node_id, dst_node_ids, sealed_segment_ids,
check_task=CheckTasks.err_res,
Expand Down Expand Up @@ -3882,7 +3885,7 @@ def test_grant_db_global(self, host, port):
self.database_wrap.using_database(ct.default_db)
self.utility_wrap.describe_resource_group(ct.default_resource_group_name,
check_task=CheckTasks.check_permission_deny)

# set using db to db_name and verify grants
self.database_wrap.using_database(db_name)
self.utility_wrap.role_list_grants()
Expand Down

0 comments on commit ffdde39

Please sign in to comment.