Fix one more test

This commit is contained in:
alesapin 2021-12-02 13:41:04 +03:00
parent e704140d07
commit ff6cc14df3

View File

@ -36,6 +36,16 @@ def start(node):
node.start_clickhouse()
def delete_with_retry(node_name, path):
for _ in range(30):
try:
get_fake_zk(node_name).delete(path)
return
except:
time.sleep(0.5)
raise Exception(f"Cannot delete {path} from node {node_name}")
def test_start_offline(started_cluster):
p = Pool(3)
try:
@ -57,7 +67,7 @@ def test_start_offline(started_cluster):
finally:
p.map(start, [node1, node2, node3])
get_fake_zk("node1").delete("/test_alive")
delete_with_retry("node1", "/test_alive")
def test_start_non_existing(started_cluster):
@ -82,7 +92,7 @@ def test_start_non_existing(started_cluster):
node1.replace_in_config('/etc/clickhouse-server/config.d/enable_keeper1.xml', 'non_existing_node', 'node3')
node2.replace_in_config('/etc/clickhouse-server/config.d/enable_keeper2.xml', 'non_existing_node', 'node3')
p.map(start, [node1, node2, node3])
node2_zk.delete("/test_non_exising")
delete_with_retry("node2", "/test_non_exising")
def test_restart_third_node(started_cluster):