Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
97fd1360
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
Star
22014
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
97fd1360
编写于
11月 04, 2022
作者:
P
plum-lihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test:modify case
上级
15313357
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
11 deletion
+23
-11
tests/system-test/7-tmq/tmqSubscribeStb-r3.py
tests/system-test/7-tmq/tmqSubscribeStb-r3.py
+23
-11
未找到文件。
tests/system-test/7-tmq/tmqSubscribeStb-r3.py
浏览文件 @
97fd1360
...
...
@@ -16,8 +16,11 @@ from util.dnodes import TDDnodes
from
util.dnodes
import
TDDnode
from
util.cluster
import
*
from
util.common
import
*
sys
.
path
.
append
(
"./6-cluster"
)
sys
.
path
.
append
(
"./7-tmq"
)
from
tmqCommon
import
*
from
clusterCommonCreate
import
*
from
clusterCommonCheck
import
clusterComCheck
class
TDTestCase
:
def
__init__
(
self
):
...
...
@@ -26,6 +29,7 @@ class TDTestCase:
self
.
vgroups
=
4
self
.
ctbNum
=
1000
self
.
rowsPerTbl
=
100
self
.
dnodeNumbers
=
5
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
self
.
replicaVar
=
int
(
replicaVar
)
...
...
@@ -119,15 +123,19 @@ class TDTestCase:
tdLog
.
info
(
"================= restart dnode 2==========================="
)
cluster
.
dnodes
[
1
].
stoptaosd
()
cluster
.
dnodes
[
1
].
starttaosd
()
clusterComCheck
.
checkDnodes
(
self
.
dnodeNumbers
)
tdLog
.
info
(
"================= restart dnode 3==========================="
)
cluster
.
dnodes
[
2
].
stoptaosd
()
cluster
.
dnodes
[
2
].
starttaosd
()
clusterComCheck
.
checkDnodes
(
self
.
dnodeNumbers
)
tdLog
.
info
(
"================= restart dnode 4==========================="
)
cluster
.
dnodes
[
3
].
stoptaosd
()
cluster
.
dnodes
[
3
].
starttaosd
()
clusterComCheck
.
checkDnodes
(
self
.
dnodeNumbers
)
tdLog
.
info
(
"================= restart dnode 5==========================="
)
cluster
.
dnodes
[
4
].
stoptaosd
()
cluster
.
dnodes
[
4
].
starttaosd
()
clusterComCheck
.
checkDnodes
(
self
.
dnodeNumbers
)
pThread
.
join
()
# tdLog.info("restart taosd to ensure that the data falls into the disk")
...
...
@@ -193,9 +201,9 @@ class TDTestCase:
tdSql
.
query
(
queryString
)
totalRowsFromQuery
=
tdSql
.
getRows
()
tdLog
.
info
(
"act consume rows: %d, act query rows: %d
, expect consume rows: %d, "
%
(
totalConsumeRows
,
totalRowsFromQuery
,
expectrowcnt
))
tdLog
.
info
(
"act consume rows: %d, act query rows: %d
"
%
(
totalConsumeRows
,
totalRowsFromQuery
))
if
totalConsumeRows
!=
totalRowsFromQuery
:
if
totalConsumeRows
<
totalRowsFromQuery
:
tdLog
.
exit
(
"tmq consume rows error!"
)
# tmqCom.checkFileContent(consumerId, queryString)
...
...
@@ -224,7 +232,7 @@ class TDTestCase:
'rowsPerTbl'
:
1000
,
'batchNum'
:
100
,
'startTs'
:
1640966400000
,
# 2022-01-01 00:00:00.000
'pollDelay'
:
15
,
'pollDelay'
:
30
,
'showMsg'
:
1
,
'showRow'
:
1
,
'snapshot'
:
1
}
...
...
@@ -238,7 +246,10 @@ class TDTestCase:
queryString
=
"select ts, c1, c2 from %s.%s where t4 == 'beijing' or t4 == 'changsha' "
%
(
paraDict
[
'dbName'
],
paraDict
[
'stbName'
])
sqlString
=
"create topic %s as %s"
%
(
topicFromStb1
,
queryString
)
tdLog
.
info
(
"create topic sql: %s"
%
sqlString
)
tdSql
.
execute
(
sqlString
)
tdSql
.
execute
(
sqlString
)
tdSql
.
query
(
queryString
)
totalRowsFromQuery
=
tdSql
.
getRows
()
consumerId
=
0
expectrowcnt
=
paraDict
[
"rowsPerTbl"
]
*
paraDict
[
"ctbNum"
]
...
...
@@ -257,15 +268,19 @@ class TDTestCase:
tdLog
.
info
(
"================= restart dnode 2==========================="
)
cluster
.
dnodes
[
1
].
stoptaosd
()
cluster
.
dnodes
[
1
].
starttaosd
()
clusterComCheck
.
checkDnodes
(
self
.
dnodeNumbers
)
tdLog
.
info
(
"================= restart dnode 3==========================="
)
cluster
.
dnodes
[
2
].
stoptaosd
()
cluster
.
dnodes
[
2
].
starttaosd
()
clusterComCheck
.
checkDnodes
(
self
.
dnodeNumbers
)
tdLog
.
info
(
"================= restart dnode 4==========================="
)
cluster
.
dnodes
[
3
].
stoptaosd
()
cluster
.
dnodes
[
3
].
starttaosd
()
clusterComCheck
.
checkDnodes
(
self
.
dnodeNumbers
)
tdLog
.
info
(
"================= restart dnode 5==========================="
)
cluster
.
dnodes
[
4
].
stoptaosd
()
cluster
.
dnodes
[
4
].
starttaosd
()
clusterComCheck
.
checkDnodes
(
self
.
dnodeNumbers
)
tdLog
.
info
(
"start to check consume result"
)
expectRows
=
1
...
...
@@ -274,12 +289,9 @@ class TDTestCase:
for
i
in
range
(
expectRows
):
totalConsumeRows
+=
resultList
[
i
]
tdSql
.
query
(
queryString
)
totalRowsFromQuery
=
tdSql
.
getRows
()
tdLog
.
info
(
"act consume rows: %d, act query rows: %d "
%
(
totalConsumeRows
,
totalRowsFromQuery
))
tdLog
.
info
(
"act consume rows: %d, act query rows: %d, expect consume rows: %d, "
%
(
totalConsumeRows
,
totalRowsFromQuery
,
expectrowcnt
))
if
totalConsumeRows
!=
totalRowsFromQuery
:
if
totalConsumeRows
<
totalRowsFromQuery
:
tdLog
.
exit
(
"tmq consume rows error!"
)
# tmqCom.checkFileContent(consumerId, queryString)
...
...
@@ -290,8 +302,8 @@ class TDTestCase:
tdLog
.
printNoPrefix
(
"======== test case 2 end ...... "
)
def
run
(
self
):
self
.
prepareTestEnv
()
self
.
tmqCase1
()
#
self.prepareTestEnv()
#
self.tmqCase1()
self
.
prepareTestEnv
()
self
.
tmqCase2
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录