test(integration): poll for the cached JWT rejection sentinel instead of a single Redis read (#50014)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
mrinal-berri 2026-11-04 11:46:38 -08:00 • committed by GitHub
parent 3492453262
commit 6d60bc4929
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -535,8 +535,10 @@ def test_link_only_links_after_a_cached_rejection_from_the_previous_mode(gateway
denied: Final = _chat(rejecting, model, token)
assert denied.status_code == 403, denied.text
with Redis(host=os.environ["REDIS_HOST"], port=int(os.environ["REDIS_PORT"])) as cache:
cached: Final = cache.get(f"jwt_key_mapping:sub:{user}")
assert cached is not None and b"__NO_MAPPING__" in cached, cached
eventually(
lambda: cache.get(f"jwt_key_mapping:sub:{user}"),
lambda value: value is not None and b"__NO_MAPPING__" in value,
)
with owned_proxy(
gateway,
tmp_path,