Skip to content
Snippets Groups Projects
Commit c53e02ce authored by Georgy Moshkin's avatar Georgy Moshkin :speech_balloon:
Browse files

test: no race when joining a replicaset

parent 35f66416
No related branches found
No related tags found
1 merge request!357Fix/new replicas start read only
Pipeline #13506 passed
......@@ -7,6 +7,12 @@ from conftest import (
)
@pytest.fixture
def cluster1(cluster: Cluster):
cluster.deploy(instance_count=1, init_replication_factor=2)
return cluster
@pytest.fixture
def cluster3(cluster: Cluster):
cluster.deploy(instance_count=3, init_replication_factor=3)
......@@ -104,3 +110,19 @@ def test_2_of_3_writable(cluster3: Cluster):
wait_vclock(old_leader, rl_vclock)
assert [[1], [2]] == old_leader.eval("return box.space.test_space:select()")
# fmt: on
def test_replication_works(cluster1: Cluster):
i2 = cluster1.add_instance(wait_online=False, replicaset_id="r2")
i3 = cluster1.add_instance(wait_online=False, replicaset_id="r2")
i2.start()
i3.start()
i2.wait_online()
i3.wait_online()
@funcy.retry(tries=10, timeout=0.2)
def wait_replicas_joined(i: Instance, n: int):
assert len(i.call("box.info")["replication"]) == n
wait_replicas_joined(i2, 2)
wait_replicas_joined(i3, 2)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment