Skip to content

Commit 61677eb

Browse files
committed
Fix async test_moved_redirection_on_slave_with_default
The test was broken for a while after migrating to all-in-one container with Cluster
1 parent 6f63bd6 commit 61677eb

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tests/test_asyncio/test_cluster.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2804,7 +2804,6 @@ async def test_asking_error(self, r: RedisCluster) -> None:
28042804
assert ask_node._free.pop().read_response.await_count
28052805
assert res == ["MOCK_OK"]
28062806

2807-
@skip_if_server_version_gte("7.0.0")
28082807
async def test_moved_redirection_on_slave_with_default(
28092808
self, r: RedisCluster
28102809
) -> None:
@@ -2814,6 +2813,7 @@ async def test_moved_redirection_on_slave_with_default(
28142813
# set read_from_replicas to True
28152814
r.read_from_replicas = True
28162815
primary = r.get_node_from_key(key, False)
2816+
replica = r.get_node_from_key(key, True)
28172817
moved_error = f"{r.keyslot(key)} {primary.host}:{primary.port}"
28182818

28192819
parse_response_orig = primary.parse_response
@@ -2824,11 +2824,7 @@ async def test_moved_redirection_on_slave_with_default(
28242824
async def parse_response(
28252825
self, connection: Connection, command: str, **kwargs: Any
28262826
) -> Any:
2827-
if (
2828-
command == "GET"
2829-
and self.host != primary.host
2830-
and self.port != primary.port
2831-
):
2827+
if command == "GET" and self.port != primary.port:
28322828
raise MovedError(moved_error)
28332829

28342830
return await parse_response_orig(connection, command, **kwargs)

0 commit comments

Comments
 (0)