File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -3163,7 +3163,7 @@ async def test_readonly_replication(
3163
3163
await m1_node .client .execute_command ("SET X 1" )
3164
3164
3165
3165
logging .debug ("start replication" )
3166
- await r1_node .admin_client .execute_command (f"replicaof localhost { m1_node .instance .port } " )
3166
+ await r1_node .admin_client .execute_command (f"replicaof localhost { m1_node .instance .admin_port } " )
3167
3167
3168
3168
await wait_available_async (r1_node .admin_client )
3169
3169
@@ -3174,6 +3174,23 @@ async def test_readonly_replication(
3174
3174
# This behavior can be changed in the future
3175
3175
assert await r1_node .client .execute_command ("GET Y" ) == None
3176
3176
3177
+ m1_node .replicas = []
3178
+
3179
+ logging .debug ("Push config without replica" )
3180
+ await push_config (
3181
+ json .dumps (generate_config (master_nodes )), [node .admin_client for node in nodes ]
3182
+ )
3183
+
3184
+ with pytest .raises (redis .exceptions .ResponseError ) as moved_error :
3185
+ await r1_node .client .execute_command ("GET X" )
3186
+
3187
+ assert str (moved_error .value ) == f"MOVED 7165 127.0.0.1:{ instances [0 ].port } "
3188
+
3189
+ with pytest .raises (redis .exceptions .ResponseError ) as moved_error :
3190
+ await r1_node .client .execute_command ("GET Y" )
3191
+
3192
+ assert str (moved_error .value ) == f"MOVED 3036 127.0.0.1:{ instances [0 ].port } "
3193
+
3177
3194
3178
3195
@dfly_args ({"proactor_threads" : 2 , "cluster_mode" : "yes" })
3179
3196
async def test_cancel_blocking_cmd_during_mygration_finalization (df_factory : DflyInstanceFactory ):
You can’t perform that action at this time.
0 commit comments