From 3e86bafbde1ba621ff2027373ba322393ee2ee98 Mon Sep 17 00:00:00 2001 From: mubashir1osmani Date: Mon, 10 Aug 2026 18:23:56 -0700 Subject: [PATCH] test(caching): bind the redaction test to a closed port, not 6379 Constructing RedisCache runs a synchronous startup ping, which the redis_no_ping fixture does not suppress. Using the default port 6379 meant that ping could reach a real local Redis, adding latency and letting local Redis availability sway an otherwise isolated unit test. Use _closed_port(), like the sibling circuit-breaker tests, so the ping refuses immediately and the test stays hermetic. --- tests/test_litellm/caching/test_redis_cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_litellm/caching/test_redis_cache.py b/tests/test_litellm/caching/test_redis_cache.py index 7bc4ac6cea8..ded1385851f 100644 --- a/tests/test_litellm/caching/test_redis_cache.py +++ b/tests/test_litellm/caching/test_redis_cache.py @@ -672,7 +672,7 @@ async def test_redis_write_failure_does_not_log_master_key(redis_no_ping, call_c """ from litellm._logging import verbose_logger - cache: Final = RedisCache(host="127.0.0.1", port=6379, socket_timeout=0.5) + cache: Final = RedisCache(host="127.0.0.1", port=_closed_port(), socket_timeout=0.5) capture: Final = _CaptureRecords() verbose_logger.addFilter(capture) try: