mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
test: add check for removing readonly replica (#4963)
This commit is contained in:
parent
2ca5bf1192
commit
707d7f0265
1 changed files with 18 additions and 1 deletions
|
@ -3163,7 +3163,7 @@ async def test_readonly_replication(
|
|||
await m1_node.client.execute_command("SET X 1")
|
||||
|
||||
logging.debug("start replication")
|
||||
await r1_node.admin_client.execute_command(f"replicaof localhost {m1_node.instance.port}")
|
||||
await r1_node.admin_client.execute_command(f"replicaof localhost {m1_node.instance.admin_port}")
|
||||
|
||||
await wait_available_async(r1_node.admin_client)
|
||||
|
||||
|
@ -3174,6 +3174,23 @@ async def test_readonly_replication(
|
|||
# This behavior can be changed in the future
|
||||
assert await r1_node.client.execute_command("GET Y") == None
|
||||
|
||||
m1_node.replicas = []
|
||||
|
||||
logging.debug("Push config without replica")
|
||||
await push_config(
|
||||
json.dumps(generate_config(master_nodes)), [node.admin_client for node in nodes]
|
||||
)
|
||||
|
||||
with pytest.raises(redis.exceptions.ResponseError) as moved_error:
|
||||
await r1_node.client.execute_command("GET X")
|
||||
|
||||
assert str(moved_error.value) == f"MOVED 7165 127.0.0.1:{instances[0].port}"
|
||||
|
||||
with pytest.raises(redis.exceptions.ResponseError) as moved_error:
|
||||
await r1_node.client.execute_command("GET Y")
|
||||
|
||||
assert str(moved_error.value) == f"MOVED 3036 127.0.0.1:{instances[0].port}"
|
||||
|
||||
|
||||
@dfly_args({"proactor_threads": 2, "cluster_mode": "yes"})
|
||||
async def test_cancel_blocking_cmd_during_mygration_finalization(df_factory: DflyInstanceFactory):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue