Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ecd39d33
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ecd39d33
编写于
3月 18, 2023
作者:
P
plum-lihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: add tmq case
上级
856912de
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
14 deletion
+15
-14
tests/system-test/7-tmq/tmqMultiConsumer.py
tests/system-test/7-tmq/tmqMultiConsumer.py
+15
-14
未找到文件。
tests/system-test/7-tmq/tmqMultiConsumer.py
浏览文件 @
ecd39d33
...
...
@@ -20,7 +20,7 @@ from tmqCommon import *
class
TDTestCase
:
def
__init__
(
self
):
self
.
vgroups
=
32
self
.
ctbNum
=
1
50
00
self
.
ctbNum
=
100
self
.
rowsPerTbl
=
1000
self
.
snapshot
=
1
self
.
replicaVar
=
3
...
...
@@ -91,7 +91,7 @@ class TDTestCase:
'rowsPerTbl'
:
10000
,
'batchNum'
:
1000
,
'startTs'
:
1640966400000
,
# 2022-01-01 00:00:00.000
'pollDelay'
:
1
0
,
'pollDelay'
:
2
0
,
'showMsg'
:
1
,
'showRow'
:
1
,
'snapshot'
:
1
}
...
...
@@ -101,8 +101,7 @@ class TDTestCase:
paraDict
[
'rowsPerTbl'
]
=
self
.
rowsPerTbl
paraDict
[
'snapshot'
]
=
self
.
snapshot
topicNameList
=
[
'topic1'
]
expectRowsList
=
[]
topicNameList
=
[
'topic1'
,
'topic2'
]
tmqCom
.
initConsumerTable
()
tdLog
.
info
(
"create topics from stb with filter"
)
...
...
@@ -112,14 +111,18 @@ class TDTestCase:
sqlString
=
"create topic %s as %s"
%
(
topicNameList
[
0
],
queryString
)
tdLog
.
info
(
"create topic sql: %s"
%
sqlString
)
tdSql
.
execute
(
sqlString
)
tdSql
.
query
(
queryString
)
expectRowsList
.
append
(
tdSql
.
getRows
())
sqlString
=
"create topic %s as %s"
%
(
topicNameList
[
1
],
queryString
)
tdLog
.
info
(
"create topic sql: %s"
%
sqlString
)
tdSql
.
execute
(
sqlString
)
# tdSql.query(queryString)
# expectRowsList.append(tdSql.getRows())
# init consume info, and start tmq_sim, then check consume result
tdLog
.
info
(
"insert consume info to consume processor"
)
consumerId
=
0
expectrowcnt
=
paraDict
[
"rowsPerTbl"
]
*
paraDict
[
"ctbNum"
]
topicList
=
topicNameList
[
0
]
expectrowcnt
=
paraDict
[
"rowsPerTbl"
]
*
paraDict
[
"ctbNum"
]
*
4
topicList
=
topicNameList
[
0
]
+
','
+
topicNameList
[
0
]
+
','
+
topicNameList
[
1
]
ifcheckdata
=
0
ifManualCommit
=
1
keyList
=
'group.id:cgrp1, enable.auto.commit:true, auto.commit.interval.ms:1000, auto.offset.reset:earliest'
...
...
@@ -135,18 +138,16 @@ class TDTestCase:
# continue to insert new rows
paraDict
[
'startTs'
]
=
paraDict
[
'startTs'
]
+
int
(
self
.
rowsPerTbl
)
pInsertThread
=
tmqCom
.
asyncInsertDataByInterlace
(
paraDict
)
pInsertThread
.
join
()
expectRowsList
[
0
]
=
expectRowsList
[
0
]
*
2
pInsertThread
.
join
()
expectRows
=
2
resultList
=
tmqCom
.
selectConsumeResult
(
expectRows
)
actConsumeTotalRows
=
resultList
[
0
]
+
resultList
[
1
]
tdLog
.
info
(
"act consume rows: %d, expect consume rows: %d"
%
(
actConsumeTotalRows
,
expect
RowsList
[
0
]
))
tdLog
.
info
(
"act consume rows: %d, expect consume rows: %d"
%
(
actConsumeTotalRows
,
expect
rowcnt
))
if
(
expectRowsList
[
0
]
<=
actConsumeTotalRows
)
or
((
resultList
[
0
]
==
0
)
and
(
resultList
[
1
]
>=
expectRowsList
[
0
]))
or
((
resultList
[
1
]
==
0
)
and
(
resultList
[
0
]
>=
expectRowsList
[
0
]
)):
tdLog
.
info
(
"expect consume rows: %d, act consume rows: %d"
%
(
expect
RowsList
[
0
],
resultList
[
0
]
))
if
not
((
expectrowcnt
<=
actConsumeTotalRows
)
or
((
resultList
[
0
]
==
0
)
and
(
resultList
[
1
]
>=
expectrowcnt
))
or
((
resultList
[
1
]
==
0
)
and
(
resultList
[
0
]
>=
expectrowcnt
)
)):
tdLog
.
info
(
"expect consume rows: %d, act consume rows: %d"
%
(
expect
rowcnt
,
actConsumeTotalRows
))
tdLog
.
exit
(
"%d tmq consume rows error!"
%
consumerId
)
# tmqCom.checkFileContent(consumerId, queryString)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录