Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
1ce0d4db
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,发现更多精彩内容 >>
未验证
提交
1ce0d4db
编写于
10月 10, 2020
作者:
F
filimonov
提交者:
GitHub
10月 10, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update test.py
similar change for test_kafka_duplicates_when_commit_failed
上级
60f4e561
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
6 deletion
+13
-6
tests/integration/test_storage_kafka/test.py
tests/integration/test_storage_kafka/test.py
+13
-6
未找到文件。
tests/integration/test_storage_kafka/test.py
浏览文件 @
1ce0d4db
...
...
@@ -2040,9 +2040,9 @@ def test_bad_reschedule(kafka_cluster):
assert
int
(
instance
.
query
(
"SELECT max(consume_ts) - min(consume_ts) FROM test.destination"
))
<
8
@
pytest
.
mark
.
timeout
(
12
00
)
@
pytest
.
mark
.
timeout
(
3
00
)
def
test_kafka_duplicates_when_commit_failed
(
kafka_cluster
):
messages
=
[
json
.
dumps
({
'key'
:
j
+
1
,
'value'
:
'x'
*
300
})
for
j
in
range
(
22
)]
messages
=
[
json
.
dumps
({
'key'
:
j
+
1
,
'value'
:
'x'
*
300
})
for
j
in
range
(
1
)]
kafka_produce
(
'duplicates_when_commit_failed'
,
messages
)
instance
.
query
(
'''
...
...
@@ -2055,8 +2055,16 @@ def test_kafka_duplicates_when_commit_failed(kafka_cluster):
kafka_topic_list = 'duplicates_when_commit_failed',
kafka_group_name = 'duplicates_when_commit_failed',
kafka_format = 'JSONEachRow',
kafka_max_block_size = 20;
kafka_max_block_size = 20,
kafka_flush_interval_ms = 1000;
SELECT * FROM test.kafka LIMIT 1; /* do subscription & assignment in advance (it can take different time, test rely on timing, so can flap otherwise) */
'''
)
messages
=
[
json
.
dumps
({
'key'
:
j
+
1
,
'value'
:
'x'
*
300
})
for
j
in
range
(
22
)]
kafka_produce
(
'duplicates_when_commit_failed'
,
messages
)
instance
.
query
(
'''
CREATE TABLE test.view (key UInt64, value String)
ENGINE = MergeTree()
ORDER BY key;
...
...
@@ -2067,15 +2075,14 @@ def test_kafka_duplicates_when_commit_failed(kafka_cluster):
'''
)
# print time.strftime("%m/%d/%Y %H:%M:%S")
time
.
sleep
(
12
)
# 5-6 sec to connect to kafka, do subscription, and fetch 20 rows, another 10 sec for MV, after that commit should happen
time
.
sleep
(
3
)
# MV will work for 10 sec, after that commit should happen, we want to pause before
# print time.strftime("%m/%d/%Y %H:%M:%S")
kafka_cluster
.
pause_container
(
'kafka1'
)
# that timeout it VERY important, and picked after lot of experiments
# when too low (<30sec) librdkafka will not report any timeout (alternative is to decrease the default session timeouts for librdkafka)
# when too high (>50sec) broker will decide to remove us from the consumer group, and will start answering "Broker: Unknown member"
time
.
sleep
(
4
0
)
time
.
sleep
(
4
2
)
# print time.strftime("%m/%d/%Y %H:%M:%S")
kafka_cluster
.
unpause_container
(
'kafka1'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录