Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2cf7763b
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看板
未验证
提交
2cf7763b
编写于
4月 25, 2023
作者:
H
Haojun Liao
提交者:
GitHub
4月 25, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #21046 from taosdata/fix/TD-22671
opti:test cases for tmq
上级
d1732137
a35629d1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
58 addition
and
58 deletion
+58
-58
tests/system-test/6-cluster/clusterCommonCreate.py
tests/system-test/6-cluster/clusterCommonCreate.py
+20
-20
tests/system-test/7-tmq/subscribeDb3.py
tests/system-test/7-tmq/subscribeDb3.py
+24
-22
tests/system-test/7-tmq/tmqCommon.py
tests/system-test/7-tmq/tmqCommon.py
+11
-13
tests/system-test/7-tmq/tmqConsumerGroup.py
tests/system-test/7-tmq/tmqConsumerGroup.py
+1
-1
tests/system-test/7-tmq/tmqDnodeRestart1.py
tests/system-test/7-tmq/tmqDnodeRestart1.py
+2
-2
未找到文件。
tests/system-test/6-cluster/clusterCommonCreate.py
浏览文件 @
2cf7763b
...
...
@@ -94,26 +94,26 @@ class ClusterComCreate:
tdLog
.
info
(
shellCmd
)
os
.
system
(
shellCmd
)
def
getStartConsumeNotifyFromTmqsim
(
self
,
cdbName
=
'cdb'
):
while
1
:
tdSql
.
query
(
"select * from %s.notifyinfo"
%
cdbName
)
#tdLog.info("row: %d, %l64d, %l64d"%(tdSql.getData(0, 1),tdSql.getData(0, 2),tdSql.getData(0, 3))
if
(
tdSql
.
getRows
()
==
1
)
and
(
tdSql
.
getData
(
0
,
1
)
==
0
):
break
else
:
time
.
sleep
(
0.1
)
return
def
getStartCommitNotifyFromTmqsim
(
self
,
cdbName
=
'cdb'
):
while
1
:
tdSql
.
query
(
"select * from %s.notifyinfo"
%
cdbName
)
#tdLog.info("row: %d, %l64d, %l64d"%(tdSql.getData(0, 1),tdSql.getData(0, 2),tdSql.getData(0, 3))
if
tdSql
.
getRows
()
==
2
:
print
(
tdSql
.
getData
(
0
,
1
),
tdSql
.
getData
(
1
,
1
))
if
tdSql
.
getData
(
1
,
1
)
==
1
:
break
time
.
sleep
(
0.1
)
return
#
def getStartConsumeNotifyFromTmqsim(self,cdbName='cdb'):
#
while 1:
#
tdSql.query("select * from %s.notifyinfo"%cdbName)
#
#tdLog.info("row: %d, %l64d, %l64d"%(tdSql.getData(0, 1),tdSql.getData(0, 2),tdSql.getData(0, 3))
#
if (tdSql.getRows() == 1) and (tdSql.getData(0, 1) == 0):
#
break
#
else:
#
time.sleep(0.1)
#
return
#
#
def getStartCommitNotifyFromTmqsim(self,cdbName='cdb'):
#
while 1:
#
tdSql.query("select * from %s.notifyinfo"%cdbName)
#
#tdLog.info("row: %d, %l64d, %l64d"%(tdSql.getData(0, 1),tdSql.getData(0, 2),tdSql.getData(0, 3))
#
if tdSql.getRows() == 2 :
#
print(tdSql.getData(0, 1), tdSql.getData(1, 1))
#
if tdSql.getData(1, 1) == 1:
#
break
#
time.sleep(0.1)
#
return
def
create_database
(
self
,
tsql
,
dbName
,
dropFlag
=
1
,
vgroups
=
4
,
replica
=
1
):
if
dropFlag
==
1
:
...
...
tests/system-test/7-tmq/subscribeDb3.py
浏览文件 @
2cf7763b
...
...
@@ -10,6 +10,8 @@ from util.log import *
from
util.sql
import
*
from
util.cases
import
*
from
util.dnodes
import
*
sys
.
path
.
append
(
"./7-tmq"
)
from
tmqCommon
import
*
class
TDTestCase
:
hostname
=
socket
.
gethostname
()
...
...
@@ -67,26 +69,26 @@ class TDTestCase:
tdLog
.
info
(
"consume info sql: %s"
%
sql
)
tdSql
.
query
(
sql
)
def
getStartConsumeNotifyFromTmqsim
(
self
,
cdbName
=
'cdb'
):
while
1
:
tdSql
.
query
(
"select * from %s.notifyinfo"
%
cdbName
)
#tdLog.info("row: %d, %l64d, %l64d"%(tdSql.getData(0, 1),tdSql.getData(0, 2),tdSql.getData(0, 3))
if
(
tdSql
.
getRows
()
==
1
)
and
(
tdSql
.
getData
(
0
,
1
)
==
0
):
break
else
:
time
.
sleep
(
0.1
)
return
def
getStartCommitNotifyFromTmqsim
(
self
,
cdbName
=
'cdb'
):
while
1
:
tdSql
.
query
(
"select * from %s.notifyinfo"
%
cdbName
)
#tdLog.info("row: %d, %l64d, %l64d"%(tdSql.getData(0, 1),tdSql.getData(0, 2),tdSql.getData(0, 3))
if
tdSql
.
getRows
()
==
2
:
tdLog
.
info
(
"row[0][1]: %d, row[1][1]: %d"
%
(
tdSql
.
getData
(
0
,
1
),
tdSql
.
getData
(
1
,
1
)))
if
tdSql
.
getData
(
1
,
1
)
==
1
:
break
time
.
sleep
(
0.1
)
return
#
def getStartConsumeNotifyFromTmqsim(self,cdbName='cdb'):
#
while 1:
#
tdSql.query("select * from %s.notifyinfo"%cdbName)
#
#tdLog.info("row: %d, %l64d, %l64d"%(tdSql.getData(0, 1),tdSql.getData(0, 2),tdSql.getData(0, 3))
#
if (tdSql.getRows() == 1) and (tdSql.getData(0, 1) == 0):
#
break
#
else:
#
time.sleep(0.1)
#
return
#
#
def getStartCommitNotifyFromTmqsim(self,cdbName='cdb'):
#
while 1:
#
tdSql.query("select * from %s.notifyinfo"%cdbName)
#
#tdLog.info("row: %d, %l64d, %l64d"%(tdSql.getData(0, 1),tdSql.getData(0, 2),tdSql.getData(0, 3))
#
if tdSql.getRows() == 2 :
#
tdLog.info("row[0][1]: %d, row[1][1]: %d"%(tdSql.getData(0, 1), tdSql.getData(1, 1)))
#
if tdSql.getData(1, 1) == 1:
#
break
#
time.sleep(0.1)
#
return
def
selectConsumeResult
(
self
,
expectRows
,
cdbName
=
'cdb'
):
resultList
=
[]
...
...
@@ -233,7 +235,7 @@ class TDTestCase:
self
.
startTmqSimProcess
(
buildPath
,
cfgPath
,
pollDelay
,
parameterDict
[
"dbName"
],
showMsg
,
showRow
)
tdLog
.
info
(
"wait the notify info of start consume"
)
self
.
getStartConsumeNotifyFromTmqsim
()
tmqCom
.
getStartConsumeNotifyFromTmqsim
()
tdLog
.
info
(
"pkill consume processor"
)
if
(
platform
.
system
().
lower
()
==
'windows'
):
...
...
@@ -311,7 +313,7 @@ class TDTestCase:
# time.sleep(6)
tdLog
.
info
(
"start to wait commit notify"
)
self
.
getStartCommitNotifyFromTmqsim
()
tmqCom
.
getStartCommitNotifyFromTmqsim
()
tdLog
.
info
(
"pkill consume processor"
)
if
(
platform
.
system
().
lower
()
==
'windows'
):
...
...
tests/system-test/7-tmq/tmqCommon.py
浏览文件 @
2cf7763b
...
...
@@ -145,32 +145,30 @@ class TMQCom:
processID
=
subprocess
.
check_output
(
psCmd
,
shell
=
True
).
decode
(
"utf-8"
)
tdLog
.
debug
(
"%s is stopped by kill -INT"
%
(
processorName
))
def
getStartConsumeNotifyFromTmqsim
(
self
,
cdbName
=
'cdb'
,
rows
=
1
):
def
getStartConsumeNotifyFromTmqsim
(
self
,
cdbName
=
'cdb'
):
loopFlag
=
1
while
loopFlag
:
tdSql
.
query
(
"select * from %s.notifyinfo"
%
cdbName
)
#tdLog.info("row: %d, %l64d, %l64d"%(tdSql.getData(0, 1),tdSql.getData(0, 2),tdSql.getData(0, 3))
actRows
=
tdSql
.
getRows
()
if
(
actRows
>=
rows
):
for
i
in
range
(
actRows
):
if
tdSql
.
getData
(
i
,
1
)
==
0
:
loopFlag
=
0
break
for
i
in
range
(
actRows
):
if
tdSql
.
getData
(
i
,
1
)
==
0
:
loopFlag
=
0
break
time
.
sleep
(
0.02
)
return
def
getStartCommitNotifyFromTmqsim
(
self
,
cdbName
=
'cdb'
,
rows
=
2
):
def
getStartCommitNotifyFromTmqsim
(
self
,
cdbName
=
'cdb'
):
loopFlag
=
1
while
loopFlag
:
tdSql
.
query
(
"select * from %s.notifyinfo"
%
cdbName
)
#tdLog.info("row: %d, %l64d, %l64d"%(tdSql.getData(0, 1),tdSql.getData(0, 2),tdSql.getData(0, 3))
actRows
=
tdSql
.
getRows
()
if
(
actRows
>=
rows
):
for
i
in
range
(
actRows
):
if
tdSql
.
getData
(
i
,
1
)
==
1
:
loopFlag
=
0
break
time
.
sleep
(
0.10
)
for
i
in
range
(
actRows
):
if
tdSql
.
getData
(
i
,
1
)
==
1
:
loopFlag
=
0
break
time
.
sleep
(
0.02
)
return
def
create_database
(
self
,
tsql
,
dbName
,
dropFlag
=
1
,
vgroups
=
4
,
replica
=
1
):
...
...
tests/system-test/7-tmq/tmqConsumerGroup.py
浏览文件 @
2cf7763b
...
...
@@ -100,7 +100,7 @@ class TDTestCase:
tdLog
.
info
(
"wait consumer commit notify"
)
# tmqCom.getStartCommitNotifyFromTmqsim(rows=4)
tmqCom
.
getStartConsumeNotifyFromTmqsim
(
rows
=
2
)
tmqCom
.
getStartConsumeNotifyFromTmqsim
()
tdLog
.
info
(
"pkill one consume processor"
)
tmqCom
.
stopTmqSimProcess
(
'tmq_sim_new'
)
...
...
tests/system-test/7-tmq/tmqDnodeRestart1.py
浏览文件 @
2cf7763b
...
...
@@ -121,7 +121,7 @@ class TDTestCase:
tmqCom
.
startTmqSimProcess
(
pollDelay
=
paraDict
[
'pollDelay'
],
dbName
=
paraDict
[
"dbName"
],
showMsg
=
paraDict
[
'showMsg'
],
showRow
=
paraDict
[
'showRow'
],
snapshot
=
paraDict
[
'snapshot'
])
# time.sleep(3)
tmqCom
.
getStartCommitNotifyFromTmqsim
(
'cdb'
,
1
)
tmqCom
.
getStartCommitNotifyFromTmqsim
()
tdLog
.
info
(
"create some new child table and insert data for latest mode"
)
paraDict
[
"batchNum"
]
=
100
...
...
@@ -205,7 +205,7 @@ class TDTestCase:
tdLog
.
info
(
"start consume processor"
)
tmqCom
.
startTmqSimProcess
(
pollDelay
=
paraDict
[
'pollDelay'
],
dbName
=
paraDict
[
"dbName"
],
showMsg
=
paraDict
[
'showMsg'
],
showRow
=
paraDict
[
'showRow'
],
snapshot
=
paraDict
[
'snapshot'
])
tmqCom
.
getStartCommitNotifyFromTmqsim
(
'cdb'
,
1
)
tmqCom
.
getStartCommitNotifyFromTmqsim
()
tdLog
.
info
(
"create some new child table and insert data for latest mode"
)
paraDict
[
"batchNum"
]
=
10
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录