提交 0cebefae 编写于 作者: V Vitaly Baranov

The restart_clickhouse() function in integration tests now waits until the server is restarted.

上级 91523752
......@@ -686,6 +686,9 @@ class ClickHouseInstance:
self.exec_in_container(["bash", "-c", "pkill {} clickhouse".format("-9" if kill else "")], user='root')
time.sleep(stop_start_wait_sec)
self.exec_in_container(["bash", "-c", "{} --daemon".format(CLICKHOUSE_START_COMMAND)], user=str(os.getuid()))
# wait start
from helpers.test_tools import assert_eq_with_retry
assert_eq_with_retry(self, "select 1", "1", retry_count=int(stop_start_wait_sec / 0.5), sleep_time=0.5)
def exec_in_container(self, cmd, detach=False, **kwargs):
container = self.get_docker_handle()
......
......@@ -1164,7 +1164,6 @@ def test_kill_while_insert(start_cluster):
except:
""""""
time.sleep(0.5)
assert node1.query("SELECT count() FROM {name}".format(name=name)).splitlines() == ["10"]
finally:
......
......@@ -47,7 +47,6 @@ def test_startup_without_zookeeper(start_cluster):
node1.query("INSERT INTO test_table VALUES ('2018-10-01', 1), ('2018-10-02', 2), ('2018-10-03', 3)")
node1.restart_clickhouse()
time.sleep(5)
assert node1.query("SELECT COUNT(*) from test_table") == "3\n"
assert node1.query("SELECT is_readonly from system.replicas where table='test_table'") == "1\n"
......
......@@ -44,5 +44,3 @@ def test_live_view_dependency(started_cluster):
instance.query("CREATE TABLE b_load_second.mt (a Int32) Engine=MergeTree order by tuple()")
instance.query("CREATE LIVE VIEW a_load_first.lv AS SELECT sum(a) FROM b_load_second.mt", settings={'allow_experimental_live_view': 1})
instance.restart_clickhouse()
time.sleep(5)
instance.query("SELECT 1")
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册