mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 20:32:43 +00:00
Restart docker
This commit is contained in:
parent
96cb483d60
commit
1fcd7cedf4
tests
@ -56,6 +56,7 @@ def get_env_for_runner(build_path, repo_path, result_path, work_path):
|
|||||||
my_env["CLICKHOUSE_TESTS_RESULT_PATH"] = result_path
|
my_env["CLICKHOUSE_TESTS_RESULT_PATH"] = result_path
|
||||||
my_env["CLICKHOUSE_TESTS_BASE_CONFIG_DIR"] = f"{repo_path}/programs/server"
|
my_env["CLICKHOUSE_TESTS_BASE_CONFIG_DIR"] = f"{repo_path}/programs/server"
|
||||||
my_env["CLICKHOUSE_TESTS_JSON_PARAMS_PATH"] = os.path.join(work_path, "params.json")
|
my_env["CLICKHOUSE_TESTS_JSON_PARAMS_PATH"] = os.path.join(work_path, "params.json")
|
||||||
|
my_env["CLICKHOUSE_TESTS_RUNNER_RESTART_DOCKER"] = '0'
|
||||||
|
|
||||||
return my_env
|
return my_env
|
||||||
|
|
||||||
|
@ -135,6 +135,29 @@ def clear_ip_tables_and_restart_daemons():
|
|||||||
except subprocess.CalledProcessError as err:
|
except subprocess.CalledProcessError as err:
|
||||||
logging.info("docker rm excepted: " + str(err))
|
logging.info("docker rm excepted: " + str(err))
|
||||||
|
|
||||||
|
# don't restart docker if it's disabled
|
||||||
|
if os.environ.get("CLICKHOUSE_TESTS_RUNNER_RESTART_DOCKER", '1') == '1':
|
||||||
|
try:
|
||||||
|
logging.info("Stopping docker daemon")
|
||||||
|
subprocess.check_output("service docker stop", shell=True)
|
||||||
|
except subprocess.CalledProcessError as err:
|
||||||
|
logging.info("docker stop excepted: " + str(err))
|
||||||
|
|
||||||
|
try:
|
||||||
|
for i in range(200):
|
||||||
|
try:
|
||||||
|
logging.info("Restarting docker %s", i)
|
||||||
|
subprocess.check_output("service docker start", shell=True)
|
||||||
|
subprocess.check_output("docker ps", shell=True)
|
||||||
|
break
|
||||||
|
except subprocess.CalledProcessError as err:
|
||||||
|
time.sleep(0.5)
|
||||||
|
logging.info("Waiting docker to start, current %s", str(err))
|
||||||
|
else:
|
||||||
|
raise Exception("Docker daemon doesn't responding")
|
||||||
|
except subprocess.CalledProcessError as err:
|
||||||
|
logging.info("Can't reload docker: " + str(err))
|
||||||
|
|
||||||
iptables_iter = 0
|
iptables_iter = 0
|
||||||
try:
|
try:
|
||||||
for i in range(1000):
|
for i in range(1000):
|
||||||
|
Loading…
Reference in New Issue
Block a user