Merge pull request #44859 from ClickHouse/wait-zk-process-stopped

Wait for ZK process to stop in tests using snapshot
This commit is contained in:
Antonio Andelic 2023-01-03 13:08:59 +01:00 committed by GitHub
commit e68b98aac3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -29,6 +29,11 @@ def start_zookeeper(node):
def stop_zookeeper(node):
node.exec_in_container(["bash", "-c", "/opt/zookeeper/bin/zkServer.sh stop"])
timeout = time.time() + 60
while node.get_process_pid("zookeeper") != None:
if time.time() > timeout:
raise Exception("Failed to stop ZooKeeper in 60 secs")
time.sleep(0.2)
def clear_zookeeper(node):

View File

@ -24,6 +24,11 @@ def start_zookeeper():
def stop_zookeeper():
node.exec_in_container(["bash", "-c", "/opt/zookeeper/bin/zkServer.sh stop"])
timeout = time.time() + 60
while node.get_process_pid("zookeeper") != None:
if time.time() > timeout:
raise Exception("Failed to stop ZooKeeper in 60 secs")
time.sleep(0.2)
def clear_zookeeper():