test(parallel_request_limiter_v3): clear force_redis_hash_tag_grouping flag before default-behaviour assertion

Greptile flagged the default-behaviour assertion as fragile under
test ordering: another test that sets litellm.force_redis_hash_tag_grouping
and exits without clearing would carry the flag into this test's
default-path check. Reset the flag explicitly at the top.
This commit is contained in:
Chenglun Hu 2026-06-10 09:27:48 +08:00
parent 6e8aa3d213
commit 12dce42b35

View file

@ -1880,6 +1880,9 @@ def test_group_keys_by_hash_tag_force_grouping_flag():
"{team:1f44b322-dead-41d9-9244-09515df45269}:tokens",
]
# Defensive: clear any prior test leakage before asserting default behaviour.
setattr(litellm, "force_redis_hash_tag_grouping", False)
# Default: no flag, non-cluster cache -> single group (current behaviour).
groups_default = handler._group_keys_by_hash_tag(keys_two_slots)
assert len(groups_default) == 1