Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
24321c28
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
24321c28
编写于
2月 24, 2021
作者:
F
fastio
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add test case
上级
fea28366
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
1 deletion
+24
-1
tests/integration/test_replicated_merge_tree_with_auxiliary_zookeepers/test.py
...t_replicated_merge_tree_with_auxiliary_zookeepers/test.py
+24
-1
未找到文件。
tests/integration/test_replicated_merge_tree_with_auxiliary_zookeepers/test.py
浏览文件 @
24321c28
...
...
@@ -6,7 +6,6 @@ from helpers.cluster import ClickHouseCluster
from
helpers.client
import
QueryRuntimeException
from
helpers.test_tools
import
TSV
cluster
=
ClickHouseCluster
(
__file__
)
cluster
=
ClickHouseCluster
(
__file__
)
node1
=
cluster
.
add_instance
(
"node1"
,
main_configs
=
[
"configs/zookeeper_config.xml"
,
"configs/remote_servers.xml"
],
with_zookeeper
=
True
)
node2
=
cluster
.
add_instance
(
"node2"
,
main_configs
=
[
"configs/zookeeper_config.xml"
,
"configs/remote_servers.xml"
],
with_zookeeper
=
True
)
...
...
@@ -78,3 +77,27 @@ def test_create_replicated_merge_tree_with_not_exists_auxiliary_zookeeper(starte
ENGINE = ReplicatedMergeTree('zookeeper_not_exits:/clickhouse/tables/test/test_auxiliary_zookeeper', '{replica}')
ORDER BY a;
'''
.
format
(
replica
=
node1
.
name
))
# Drop table with auxiliary zookeeper.
def
test_drop_replicated_merge_tree_with_auxiliary_zookeeper
(
started_cluster
):
drop_table
([
node1
,
node2
],
"test_auxiliary_zookeeper"
)
for
node
in
[
node1
,
node2
]:
node
.
query
(
'''
CREATE TABLE test_auxiliary_zookeeper(a Int32)
ENGINE = ReplicatedMergeTree('zookeeper2:/clickhouse/tables/test/test_auxiliary_zookeeper', '{replica}')
ORDER BY a;
'''
.
format
(
replica
=
node
.
name
))
# Insert data into node1, and query it from node2.
node1
.
query
(
"INSERT INTO test_auxiliary_zookeeper VALUES (1)"
)
time
.
sleep
(
5
)
expected
=
"1
\n
"
assert
TSV
(
node1
.
query
(
"SELECT a FROM test_auxiliary_zookeeper"
))
==
TSV
(
expected
)
assert
TSV
(
node2
.
query
(
"SELECT a FROM test_auxiliary_zookeeper"
))
==
TSV
(
expected
)
zk
=
cluster
.
get_kazoo_client
(
'zoo1'
)
assert
zk
.
exists
(
'/clickhouse/tables/test/test_auxiliary_zookeeper'
)
drop_table
([
node1
,
node2
],
"test_auxiliary_zookeeper"
)
assert
zk
.
exists
(
'/clickhouse/tables/test/test_auxiliary_zookeeper'
)
is
None
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录