Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bf45ff56
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
bf45ff56
编写于
4月 11, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:modify fileContent for data compare
上级
20013b3f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
68 deletion
+17
-68
tests/system-test/7-tmq/tmq3mnodeSwitch.py
tests/system-test/7-tmq/tmq3mnodeSwitch.py
+1
-29
tests/system-test/7-tmq/tmqCheckData.py
tests/system-test/7-tmq/tmqCheckData.py
+3
-30
tests/system-test/7-tmq/tmqCommon.py
tests/system-test/7-tmq/tmqCommon.py
+13
-9
未找到文件。
tests/system-test/7-tmq/tmq3mnodeSwitch.py
浏览文件 @
bf45ff56
...
...
@@ -138,34 +138,6 @@ class TDTestCase:
else
:
tdLog
.
exit
(
"three mnodes is not ready in 10s "
)
def
checkFileContent
(
self
,
consumerId
,
queryString
):
buildPath
=
tdCom
.
getBuildPath
()
cfgPath
=
tdCom
.
getClientCfgPath
()
dstFile
=
'%s/../log/dstrows_%d.txt'
%
(
cfgPath
,
consumerId
)
cmdStr
=
'%s/build/bin/taos -c %s -s "%s >> %s"'
%
(
buildPath
,
cfgPath
,
queryString
,
dstFile
)
tdLog
.
info
(
cmdStr
)
os
.
system
(
cmdStr
)
consumeRowsFile
=
'%s/../log/consumerid_%d.txt'
%
(
cfgPath
,
consumerId
)
tdLog
.
info
(
"rows file: %s, %s"
%
(
consumeRowsFile
,
dstFile
))
consumeFile
=
open
(
consumeRowsFile
,
mode
=
'r'
)
queryFile
=
open
(
dstFile
,
mode
=
'r'
)
# skip first line for it is schema
queryFile
.
readline
()
while
True
:
dst
=
queryFile
.
readline
()
src
=
consumeFile
.
readline
()
if
dst
:
if
dst
!=
src
:
tdLog
.
exit
(
"consumerId %d consume rows is not match the rows by direct query"
%
consumerId
)
else
:
break
return
def
tmqCase1
(
self
):
tdLog
.
printNoPrefix
(
"======== test case 1: "
)
paraDict
=
{
'dbName'
:
'db1'
,
...
...
@@ -256,7 +228,7 @@ class TDTestCase:
tdLog
.
exit
(
"0 tmq consume rows error!"
)
if
expectRowsList
[
0
]
==
resultList
[
0
]:
self
.
checkFileContent
(
consumerId
,
queryString
)
tqCom
.
checkFileContent
(
consumerId
,
queryString
)
time
.
sleep
(
10
)
for
i
in
range
(
len
(
topicNameList
)):
...
...
tests/system-test/7-tmq/tmqCheckData.py
浏览文件 @
bf45ff56
...
...
@@ -5,6 +5,7 @@ import time
import
socket
import
os
import
threading
import
math
from
util.log
import
*
from
util.sql
import
*
...
...
@@ -21,34 +22,6 @@ class TDTestCase:
tdSql
.
init
(
conn
.
cursor
())
#tdSql.init(conn.cursor(), logSql) # output sql.txt file
def
checkFileContent
(
self
,
consumerId
,
queryString
):
buildPath
=
tdCom
.
getBuildPath
()
cfgPath
=
tdCom
.
getClientCfgPath
()
dstFile
=
'%s/../log/dstrows_%d.txt'
%
(
cfgPath
,
consumerId
)
cmdStr
=
'%s/build/bin/taos -c %s -s "%s >> %s"'
%
(
buildPath
,
cfgPath
,
queryString
,
dstFile
)
tdLog
.
info
(
cmdStr
)
os
.
system
(
cmdStr
)
consumeRowsFile
=
'%s/../log/consumerid_%d.txt'
%
(
cfgPath
,
consumerId
)
tdLog
.
info
(
"rows file: %s, %s"
%
(
consumeRowsFile
,
dstFile
))
consumeFile
=
open
(
consumeRowsFile
,
mode
=
'r'
)
queryFile
=
open
(
dstFile
,
mode
=
'r'
)
# skip first line for it is schema
queryFile
.
readline
()
while
True
:
dst
=
queryFile
.
readline
()
src
=
consumeFile
.
readline
()
if
dst
:
if
dst
!=
src
:
tdLog
.
exit
(
"consumerId %d consume rows is not match the rows by direct query"
%
consumerId
)
else
:
break
return
def
tmqCase1
(
self
):
tdLog
.
printNoPrefix
(
"======== test case 1: "
)
paraDict
=
{
'dbName'
:
'db1'
,
...
...
@@ -109,7 +82,7 @@ class TDTestCase:
tdLog
.
info
(
"expect consume rows: %d, act consume rows: %d"
%
(
expectRowsList
[
0
],
resultList
[
0
]))
tdLog
.
exit
(
"0 tmq consume rows error!"
)
self
.
checkFileContent
(
consumerId
,
queryString
)
tmqCom
.
checkFileContent
(
consumerId
,
queryString
)
# reinit consume info, and start tmq_sim, then check consume result
tmqCom
.
initConsumerTable
()
...
...
@@ -135,7 +108,7 @@ class TDTestCase:
tdLog
.
info
(
"expect consume rows: %d, act consume rows: %d"
%
(
expectRowsList
[
1
],
resultList
[
0
]))
tdLog
.
exit
(
"1 tmq consume rows error!"
)
self
.
checkFileContent
(
consumerId
,
queryString
)
tmqCom
.
checkFileContent
(
consumerId
,
queryString
)
# reinit consume info, and start tmq_sim, then check consume result
tmqCom
.
initConsumerTable
()
...
...
tests/system-test/7-tmq/tmqCommon.py
浏览文件 @
bf45ff56
...
...
@@ -10,7 +10,7 @@
###################################################################
# -*- coding: utf-8 -*-
import
math
from
asyncore
import
loop
from
collections
import
defaultdict
import
subprocess
...
...
@@ -462,18 +462,22 @@ class TMQCom:
for
i
in
range
(
0
,
skipRowsOfCons
):
consumeFile
.
readline
()
lines
=
0
while
True
:
dst
=
queryFile
.
readline
()
src
=
consumeFile
.
readline
()
lines
+=
1
if
dst
:
if
dst
!=
src
:
tdLog
.
info
(
"src row: %s"
%
src
)
tdLog
.
info
(
"dst row: %s"
%
dst
)
tdLog
.
exit
(
"consumerId %d consume rows[%d] is not match the rows by direct query"
%
(
consumerId
,
lines
))
else
:
dstSplit
=
dst
.
split
(
','
)
srcSplit
=
src
.
split
(
','
)
if
len
(
dstSplit
)
!=
len
(
srcSplit
):
tdLog
.
exit
(
"consumerId %d consume rows len is not match the rows by direct query"
%
consumerId
)
if
not
dst
or
not
src
:
break
for
i
in
range
(
len
(
dstSplit
)):
if
srcSplit
[
i
]
!=
dstSplit
[
i
]:
srcFloat
=
float
(
srcSplit
[
i
])
dstFloat
=
float
(
dstSplit
[
i
])
if
not
math
.
isclose
(
srcFloat
,
dstFloat
,
abs_tol
=
1e-9
):
tdLog
.
exit
(
"consumerId %d consume rows is not match the rows by direct query"
%
consumerId
)
return
def
getResultFileByTaosShell
(
self
,
consumerId
,
queryString
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录