mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 11:02:08 +00:00
Update test.py
This commit is contained in:
parent
896e995fe8
commit
09ad1732b3
@ -36,17 +36,22 @@ def drop_zk(zk):
|
||||
|
||||
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)")
|
||||
assert_eq_with_retry(node1, "SELECT COUNT(*) from test_table", "3\n")
|
||||
assert_eq_with_retry(node1, "SELECT is_readonly from system.replicas where table='test_table'", "0\n")
|
||||
assert node1.query("SELECT COUNT(*) from test_table") == "3\n"
|
||||
assert node1.query("SELECT is_readonly from system.replicas where table='test_table'") == "0\n"
|
||||
|
||||
cluster.run_kazoo_commands_with_retries(drop_zk)
|
||||
|
||||
time.sleep(5)
|
||||
assert_eq_with_retry(node1, "SELECT COUNT(*) from test_table", "3\n")
|
||||
assert_eq_with_retry(node1, "SELECT is_readonly from system.replicas where table='test_table'", "1\n")
|
||||
assert node1.query("SELECT COUNT(*) from test_table") == "3\n"
|
||||
try:
|
||||
node1.query("INSERT INTO test_table VALUES ('2018-10-01', 1), ('2018-10-02', 2), ('2018-10-03', 3)")
|
||||
assert False, "Insert passed without zookeeper"
|
||||
except:
|
||||
pass
|
||||
|
||||
node1.restart_clickhouse()
|
||||
time.sleep(5)
|
||||
|
||||
assert_eq_with_retry(node1, "SELECT COUNT(*) from test_table", "3\n")
|
||||
assert_eq_with_retry(node1, "SELECT is_readonly from system.replicas where table='test_table'", "1\n")
|
||||
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"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user