mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-13 08:52:02 +00:00
Reworks the redis-client, connect, resolve and testing crates, adds python-compat json loads and TTL seconds, replaces the redis-store memory tier with a DualCache plus a shared failure log, and gives the Python side the Redis timeout log throttle and a request OTEL parent span for service events Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2.1 KiB
2.1 KiB
- Dev-only crate that starts real Redis for tests. Never a dependency outside
[dev-dependencies] - Same shape as
db-testing: one container per test, a handle that removes it on drop - The host port is fixed at start so
restartkeeps the same URL and a client can reconnect to it RedisClusterruns 3 masters in one container. Each node listens on the same port inside and outside and announces 127.0.0.1, so MOVED redirects work from the test process- Outages come from the container (
restart,freeze/thaw), neverDEBUG, which the official image disables - No env gate that makes a test pass without Redis. A test that can't start its container fails
RedisTlsServerserves TLS with certificatesrcgengenerates per start, forlocalhost, optionally requiring a client certificateRedisSentinelruns a primary, a replica and one sentinel in one container, all announcing 127.0.0.1.failover()returns once the replica is master and the old master is a replica.start_with_passwordputsrequirepasson the primary and the replica, which the sentinel monitors with, and the CLI helpers authenticate with itTcpProxyforwards one port from the test process.blackhole_open_connectionsstops forwarding on the connections open now while keeping their sockets open, which a container outage cannot do to one socket.RedisCluster::announce_portsmakes the nodes announce proxy ports so a cluster client reaches them only through proxiescli/cli_on_every_noderunredis-cli -einside the container for setup such as ACL users, so tests don't need a second client.-emakes an error reply fail the call, and a test whose setup changes server state also asserts that state before relying on it- Not
redis-test's server helpers, which need localredis-serverandopensslbinaries RedisDeploymentruns eitherTopology, so a test can take#[values(Topology::Standalone, Topology::Cluster)].clients()returns every client connection on every node fromCLIENT LIST, leaving out the CLI's own- Server fixtures only. This crate never depends on a Redis client crate, so the client crates can dev-depend on it without a cycle