Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
d1d3af75
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,发现更多精彩内容 >>
提交
d1d3af75
编写于
9月 09, 2020
作者:
B
bharatnc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
StorageReplicatedMergeTree - more improvements to integration test
上级
f37814b3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
15 deletion
+9
-15
tests/integration/test_cleanup_dir_after_bad_zk_conn/__init__.py
...ntegration/test_cleanup_dir_after_bad_zk_conn/__init__.py
+0
-0
tests/integration/test_cleanup_dir_after_bad_zk_conn/test.py
tests/integration/test_cleanup_dir_after_bad_zk_conn/test.py
+9
-15
未找到文件。
tests/integration/test_
replicated_zk_conn_failure
/__init__.py
→
tests/integration/test_
cleanup_dir_after_bad_zk_conn
/__init__.py
浏览文件 @
d1d3af75
文件已移动
tests/integration/test_
replicated_zk_conn_failure
/test.py
→
tests/integration/test_
cleanup_dir_after_bad_zk_conn
/test.py
浏览文件 @
d1d3af75
...
...
@@ -9,12 +9,12 @@ from helpers.network import PartitionManager
# Test flow is as follows:
# 1. Configure cluster with ZooKeeper and create a database.
# 2. Drop all connections to ZooKeeper.
# 3. Try creating the table and there w
ould
be a Poco:Exception.
# 3. Try creating the table and there w
ill
be a Poco:Exception.
# 4. Try creating the table again and there should not be any error
# that indicates that the
D
irectory for table already exists.
# that indicates that the
d
irectory for table already exists.
# 5. Final step is to restore ZooKeeper connection and verify that
# the table creation
and queries work
.
def
test_
replicated_zk_conn_failure
():
# the table creation
works
.
def
test_
cleanup_dir_after_bad_zk_conn
():
cluster
=
ClickHouseCluster
(
__file__
)
node1
=
cluster
.
add_instance
(
'node1'
,
with_zookeeper
=
True
)
try
:
...
...
@@ -30,21 +30,15 @@ def test_replicated_zk_conn_failure():
ORDER BY id;'''
with
PartitionManager
()
as
pm
:
pm
.
drop_instance_zk_connections
(
node1
)
time
.
sleep
(
5
)
time
.
sleep
(
3
)
error
=
node1
.
query_and_get_error
(
query_create
)
# Assert that there was net exception.
assert
"Poco::Exception. Code: 1000"
in
error
# Assert that the exception was due to ZooKeeper connectivity.
assert
"All connection tries failed while connecting to ZooKeeper"
in
error
# retry table creation
assert
"Poco::Exception. Code: 1000"
and
\
"All connection tries failed while connecting to ZooKeeper"
in
error
error
=
node1
.
query_and_get_error
(
query_create
)
# Should not expect any errors related to directory already existing
# and those should have been already cleaned up during the previous retry.
assert
"Directory for table data data/replica/test/ already exists"
not
in
error
# restore ZooKeeper connections.
pm
.
restore_instance_zk_connections
(
node1
)
# retry create query and query the table created.
node1
.
query
(
query_create
)
assert
"0
\n
"
in
node1
.
query
(
'''SELECT count() from replica.test FORMAT TSV'''
)
node1
.
query
(
'''INSERT INTO replica.test VALUES (1, now())'''
)
assert
"1
\n
"
in
node1
.
query
(
'''SELECT count() from replica.test FORMAT TSV'''
)
finally
:
cluster
.
shutdown
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录