@@ -2804,7 +2804,6 @@ async def test_asking_error(self, r: RedisCluster) -> None:
2804
2804
assert ask_node ._free .pop ().read_response .await_count
2805
2805
assert res == ["MOCK_OK" ]
2806
2806
2807
- @skip_if_server_version_gte ("7.0.0" )
2808
2807
async def test_moved_redirection_on_slave_with_default (
2809
2808
self , r : RedisCluster
2810
2809
) -> None :
@@ -2814,6 +2813,7 @@ async def test_moved_redirection_on_slave_with_default(
2814
2813
# set read_from_replicas to True
2815
2814
r .read_from_replicas = True
2816
2815
primary = r .get_node_from_key (key , False )
2816
+ replica = r .get_node_from_key (key , True )
2817
2817
moved_error = f"{ r .keyslot (key )} { primary .host } :{ primary .port } "
2818
2818
2819
2819
parse_response_orig = primary .parse_response
@@ -2824,11 +2824,7 @@ async def test_moved_redirection_on_slave_with_default(
2824
2824
async def parse_response (
2825
2825
self , connection : Connection , command : str , ** kwargs : Any
2826
2826
) -> 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 :
2832
2828
raise MovedError (moved_error )
2833
2829
2834
2830
return await parse_response_orig (connection , command , ** kwargs )
0 commit comments