Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bc5f62e6
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
未验证
提交
bc5f62e6
编写于
11月 04, 2022
作者:
H
Hui Li
提交者:
GitHub
11月 04, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17906 from taosdata/lihui3.0/test
test:modify case
上级
15313357
97fd1360
变更
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
浏览文件 @
bc5f62e6
...
@@ -16,8 +16,11 @@ from util.dnodes import TDDnodes
...
@@ -16,8 +16,11 @@ from util.dnodes import TDDnodes
from
util.dnodes
import
TDDnode
from
util.dnodes
import
TDDnode
from
util.cluster
import
*
from
util.cluster
import
*
from
util.common
import
*
from
util.common
import
*
sys
.
path
.
append
(
"./6-cluster"
)
sys
.
path
.
append
(
"./7-tmq"
)
sys
.
path
.
append
(
"./7-tmq"
)
from
tmqCommon
import
*
from
tmqCommon
import
*
from
clusterCommonCreate
import
*
from
clusterCommonCheck
import
clusterComCheck
class
TDTestCase
:
class
TDTestCase
:
def
__init__
(
self
):
def
__init__
(
self
):
...
@@ -26,6 +29,7 @@ class TDTestCase:
...
@@ -26,6 +29,7 @@ class TDTestCase:
self
.
vgroups
=
4
self
.
vgroups
=
4
self
.
ctbNum
=
1000
self
.
ctbNum
=
1000
self
.
rowsPerTbl
=
100
self
.
rowsPerTbl
=
100
self
.
dnodeNumbers
=
5
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
self
.
replicaVar
=
int
(
replicaVar
)
self
.
replicaVar
=
int
(
replicaVar
)
...
@@ -119,15 +123,19 @@ class TDTestCase:
...
@@ -119,15 +123,19 @@ class TDTestCase:
tdLog
.
info
(
"================= restart dnode 2==========================="
)
tdLog
.
info
(
"================= restart dnode 2==========================="
)
cluster
.
dnodes
[
1
].
stoptaosd
()
cluster
.
dnodes
[
1
].
stoptaosd
()
cluster
.
dnodes
[
1
].
starttaosd
()
cluster
.
dnodes
[
1
].
starttaosd
()
clusterComCheck
.
checkDnodes
(
self
.
dnodeNumbers
)
tdLog
.
info
(
"================= restart dnode 3==========================="
)
tdLog
.
info
(
"================= restart dnode 3==========================="
)
cluster
.
dnodes
[
2
].
stoptaosd
()
cluster
.
dnodes
[
2
].
stoptaosd
()
cluster
.
dnodes
[
2
].
starttaosd
()
cluster
.
dnodes
[
2
].
starttaosd
()
clusterComCheck
.
checkDnodes
(
self
.
dnodeNumbers
)
tdLog
.
info
(
"================= restart dnode 4==========================="
)
tdLog
.
info
(
"================= restart dnode 4==========================="
)
cluster
.
dnodes
[
3
].
stoptaosd
()
cluster
.
dnodes
[
3
].
stoptaosd
()
cluster
.
dnodes
[
3
].
starttaosd
()
cluster
.
dnodes
[
3
].
starttaosd
()
clusterComCheck
.
checkDnodes
(
self
.
dnodeNumbers
)
tdLog
.
info
(
"================= restart dnode 5==========================="
)
tdLog
.
info
(
"================= restart dnode 5==========================="
)
cluster
.
dnodes
[
4
].
stoptaosd
()
cluster
.
dnodes
[
4
].
stoptaosd
()
cluster
.
dnodes
[
4
].
starttaosd
()
cluster
.
dnodes
[
4
].
starttaosd
()
clusterComCheck
.
checkDnodes
(
self
.
dnodeNumbers
)
pThread
.
join
()
pThread
.
join
()
# tdLog.info("restart taosd to ensure that the data falls into the disk")
# tdLog.info("restart taosd to ensure that the data falls into the disk")
...
@@ -193,9 +201,9 @@ class TDTestCase:
...
@@ -193,9 +201,9 @@ class TDTestCase:
tdSql
.
query
(
queryString
)
tdSql
.
query
(
queryString
)
totalRowsFromQuery
=
tdSql
.
getRows
()
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!"
)
tdLog
.
exit
(
"tmq consume rows error!"
)
# tmqCom.checkFileContent(consumerId, queryString)
# tmqCom.checkFileContent(consumerId, queryString)
...
@@ -224,7 +232,7 @@ class TDTestCase:
...
@@ -224,7 +232,7 @@ class TDTestCase:
'rowsPerTbl'
:
1000
,
'rowsPerTbl'
:
1000
,
'batchNum'
:
100
,
'batchNum'
:
100
,
'startTs'
:
1640966400000
,
# 2022-01-01 00:00:00.000
'startTs'
:
1640966400000
,
# 2022-01-01 00:00:00.000
'pollDelay'
:
15
,
'pollDelay'
:
30
,
'showMsg'
:
1
,
'showMsg'
:
1
,
'showRow'
:
1
,
'showRow'
:
1
,
'snapshot'
:
1
}
'snapshot'
:
1
}
...
@@ -238,7 +246,10 @@ class TDTestCase:
...
@@ -238,7 +246,10 @@ class TDTestCase:
queryString
=
"select ts, c1, c2 from %s.%s where t4 == 'beijing' or t4 == 'changsha' "
%
(
paraDict
[
'dbName'
],
paraDict
[
'stbName'
])
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
)
sqlString
=
"create topic %s as %s"
%
(
topicFromStb1
,
queryString
)
tdLog
.
info
(
"create topic sql: %s"
%
sqlString
)
tdLog
.
info
(
"create topic sql: %s"
%
sqlString
)
tdSql
.
execute
(
sqlString
)
tdSql
.
execute
(
sqlString
)
tdSql
.
query
(
queryString
)
totalRowsFromQuery
=
tdSql
.
getRows
()
consumerId
=
0
consumerId
=
0
expectrowcnt
=
paraDict
[
"rowsPerTbl"
]
*
paraDict
[
"ctbNum"
]
expectrowcnt
=
paraDict
[
"rowsPerTbl"
]
*
paraDict
[
"ctbNum"
]
...
@@ -257,15 +268,19 @@ class TDTestCase:
...
@@ -257,15 +268,19 @@ class TDTestCase:
tdLog
.
info
(
"================= restart dnode 2==========================="
)
tdLog
.
info
(
"================= restart dnode 2==========================="
)
cluster
.
dnodes
[
1
].
stoptaosd
()
cluster
.
dnodes
[
1
].
stoptaosd
()
cluster
.
dnodes
[
1
].
starttaosd
()
cluster
.
dnodes
[
1
].
starttaosd
()
clusterComCheck
.
checkDnodes
(
self
.
dnodeNumbers
)
tdLog
.
info
(
"================= restart dnode 3==========================="
)
tdLog
.
info
(
"================= restart dnode 3==========================="
)
cluster
.
dnodes
[
2
].
stoptaosd
()
cluster
.
dnodes
[
2
].
stoptaosd
()
cluster
.
dnodes
[
2
].
starttaosd
()
cluster
.
dnodes
[
2
].
starttaosd
()
clusterComCheck
.
checkDnodes
(
self
.
dnodeNumbers
)
tdLog
.
info
(
"================= restart dnode 4==========================="
)
tdLog
.
info
(
"================= restart dnode 4==========================="
)
cluster
.
dnodes
[
3
].
stoptaosd
()
cluster
.
dnodes
[
3
].
stoptaosd
()
cluster
.
dnodes
[
3
].
starttaosd
()
cluster
.
dnodes
[
3
].
starttaosd
()
clusterComCheck
.
checkDnodes
(
self
.
dnodeNumbers
)
tdLog
.
info
(
"================= restart dnode 5==========================="
)
tdLog
.
info
(
"================= restart dnode 5==========================="
)
cluster
.
dnodes
[
4
].
stoptaosd
()
cluster
.
dnodes
[
4
].
stoptaosd
()
cluster
.
dnodes
[
4
].
starttaosd
()
cluster
.
dnodes
[
4
].
starttaosd
()
clusterComCheck
.
checkDnodes
(
self
.
dnodeNumbers
)
tdLog
.
info
(
"start to check consume result"
)
tdLog
.
info
(
"start to check consume result"
)
expectRows
=
1
expectRows
=
1
...
@@ -274,12 +289,9 @@ class TDTestCase:
...
@@ -274,12 +289,9 @@ class TDTestCase:
for
i
in
range
(
expectRows
):
for
i
in
range
(
expectRows
):
totalConsumeRows
+=
resultList
[
i
]
totalConsumeRows
+=
resultList
[
i
]
tdSql
.
query
(
queryString
)
tdLog
.
info
(
"act consume rows: %d, act query rows: %d "
%
(
totalConsumeRows
,
totalRowsFromQuery
))
totalRowsFromQuery
=
tdSql
.
getRows
()
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!"
)
tdLog
.
exit
(
"tmq consume rows error!"
)
# tmqCom.checkFileContent(consumerId, queryString)
# tmqCom.checkFileContent(consumerId, queryString)
...
@@ -290,8 +302,8 @@ class TDTestCase:
...
@@ -290,8 +302,8 @@ class TDTestCase:
tdLog
.
printNoPrefix
(
"======== test case 2 end ...... "
)
tdLog
.
printNoPrefix
(
"======== test case 2 end ...... "
)
def
run
(
self
):
def
run
(
self
):
self
.
prepareTestEnv
()
#
self.prepareTestEnv()
self
.
tmqCase1
()
#
self.tmqCase1()
self
.
prepareTestEnv
()
self
.
prepareTestEnv
()
self
.
tmqCase2
()
self
.
tmqCase2
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录