diff --git a/redis/cluster.py b/redis/cluster.py index fbda234137..5e6e7da546 100644 --- a/redis/cluster.py +++ b/redis/cluster.py @@ -135,6 +135,7 @@ def parse_cluster_shards(resp, **options): "redis_connect_func", "password", "port", + "queue_class", "retry", "retry_on_timeout", "socket_connect_timeout", diff --git a/tests/test_cluster.py b/tests/test_cluster.py index 1bf57a357c..58f9b77d7d 100644 --- a/tests/test_cluster.py +++ b/tests/test_cluster.py @@ -1,6 +1,7 @@ import binascii import datetime import warnings +from queue import LifoQueue, Queue from time import sleep from unittest.mock import DEFAULT, Mock, call, patch @@ -2511,6 +2512,18 @@ def test_connection_pool_class(self, connection_pool_class): node.redis_connection.connection_pool, connection_pool_class ) + @pytest.mark.parametrize("queue_class", [Queue, LifoQueue]) + def test_allow_custom_queue_class(self, queue_class): + rc = get_mocked_redis_client( + url="redis://my@DNS.com:7000", + cluster_slots=default_cluster_slots, + connection_pool_class=BlockingConnectionPool, + queue_class=queue_class, + ) + + for node in rc.nodes_manager.nodes_cache.values(): + assert node.redis_connection.connection_pool.queue_class == queue_class + @pytest.mark.onlycluster class TestClusterPubSubObject: