diff --git a/redis/cluster.py b/redis/cluster.py index a51fe9c722..7c645be755 100644 --- a/redis/cluster.py +++ b/redis/cluster.py @@ -170,6 +170,7 @@ def parse_cluster_myshardid(resp, **options): "redis_connect_func", "password", "port", + "timeout", "queue_class", "retry", "retry_on_timeout", diff --git a/tests/test_cluster.py b/tests/test_cluster.py index 4883ba66c9..2936bb0024 100644 --- a/tests/test_cluster.py +++ b/tests/test_cluster.py @@ -783,6 +783,22 @@ def on_connect(connection): _get_client(RedisCluster, request, redis_connect_func=mock) assert mock.called is True + def test_user_connection_pool_timeout(self, request): + """ + Test support in passing timeout value by the user when setting + up a RedisCluster with a BlockingConnectionPool + """ + + timeout = 3 + client = _get_client( + RedisCluster, + request, + timeout=timeout, + connection_pool_class=redis.BlockingConnectionPool, + ) + for _, node_config in client.nodes_manager.startup_nodes.items(): + assert node_config.redis_connection.connection_pool.timeout == timeout + def test_set_default_node_success(self, r): """ test successful replacement of the default cluster node