Tidy the test file

This commit is contained in:
Tuan Pham Anh 2024-10-01 08:34:01 +00:00
parent 588d5532e5
commit 860587c6c0

View File

@ -43,33 +43,29 @@ def test_stop_waiting_for_offline_hosts(started_cluster):
)
assert time.time() - start < timeout
start = time.time()
node1.query(
"CREATE TABLE test_table ON CLUSTER test_cluster (x Int) Engine=Memory",
settings=settings,
)
assert time.time() - start < timeout
node4.stop()
start = time.time()
with pytest.raises(Exception) as err:
node1.query(
"DROP TABLE IF EXISTS test_table ON CLUSTER test_cluster SYNC",
settings=settings,
)
assert "Return code: 159" in str(err.value)
assert "Code: 159. DB::Exception" in node1.query_and_get_error(
"DROP TABLE IF EXISTS test_table ON CLUSTER test_cluster SYNC",
settings=settings,
)
assert time.time() - start >= timeout
start = time.time()
with pytest.raises(Exception) as err:
node1.query(
"CREATE TABLE test_table ON CLUSTER test_cluster (x Int) Engine=Memory",
settings=settings,
)
assert "Return code: 159" in str(err.value)
assert "Code: 159. DB::Exception" in node1.query_and_get_error(
"CREATE TABLE test_table ON CLUSTER test_cluster (x Int) Engine=Memory",
settings=settings,
)
assert time.time() - start >= timeout
# set `distributed_ddl_output_mode` = `throw_only_active``
settings = {
"distributed_ddl_task_timeout": timeout,
"distributed_ddl_output_mode": "throw_only_active",