Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3c120336
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看板
未验证
提交
3c120336
编写于
7月 18, 2023
作者:
H
Hui Li
提交者:
GitHub
7月 18, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22108 from taosdata/test_main/lihui
test: check topic name len case
上级
0d922c0d
7a0fa59d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
105 addition
and
30 deletion
+105
-30
tests/system-test/7-tmq/tmqMaxTopic.py
tests/system-test/7-tmq/tmqMaxTopic.py
+105
-30
未找到文件。
tests/system-test/7-tmq/tmqMaxTopic.py
浏览文件 @
3c120336
...
...
@@ -216,41 +216,116 @@ class TDTestCase:
tdLog
.
info
(
"create topic sql: %s"
%
sqlString
)
tdSql
.
error
(
sqlString
)
# pThreadList = []
# for i in range(self.tmqMaxTopicNum):
# topic_name = f"%s%d" %(topicNamePrefix, i)
# print("======%s"%(topic_name))
# group_id_prefix = f"grp_%d"%(i)
# inputDict = {'group_id_prefix': group_id_prefix,
# 'topic_name': topic_name,
# 'pollDelay': 1
# }
# pThread = self.asyncSubscribe(inputDict)
# pThreadList.append(pThread)
# for j in range(self.tmqMaxGroups):
# pThreadList[j].join()
# time.sleep(5)
# tdSql.query('show subscriptions;')
# subscribeNum = tdSql.queryRows
# expectNum = self.tmqMaxGroups * self.tmqMaxTopicNum
# tdLog.info("loop index: %d, ======subscriptions %d and expect num: %d"%(i, subscribeNum, expectNum))
# if subscribeNum != expectNum:
# tdLog.exit("subscriptions %d not equal expect num: %d"%(subscribeNum, expectNum))
# # drop all topics
# for i in range(self.tmqMaxTopicNum):
# sqlString = "drop topic %s%d" %(topicNamePrefix, i)
# tdLog.info("drop topic sql: %s"%sqlString)
# tdSql.execute(sqlString)
tdSql
.
query
(
'show topics;'
)
topicNum
=
tdSql
.
queryRows
tdLog
.
info
(
" topic count: %d"
%
(
topicNum
))
for
i
in
range
(
topicNum
):
sqlString
=
"drop topic %s"
%
(
tdSql
.
getData
(
i
,
0
))
tdLog
.
info
(
"drop topic sql: %s"
%
sqlString
)
tdSql
.
execute
(
sqlString
)
tdLog
.
printNoPrefix
(
"======== test case 1 end ...... "
)
tdLog
.
printNoPrefix
(
"======== test case 1 end ...... "
)
def
tmqCase2
(
self
):
tdLog
.
printNoPrefix
(
"======== test case 2: test topic name len"
)
paraDict
=
{
'dbName'
:
'dbt'
,
'dropFlag'
:
1
,
'event'
:
''
,
'vgroups'
:
1
,
'stbName'
:
'stb'
,
'colPrefix'
:
'c'
,
'tagPrefix'
:
't'
,
'colSchema'
:
[{
'type'
:
'INT'
,
'count'
:
1
},{
'type'
:
'BIGINT'
,
'count'
:
1
},{
'type'
:
'DOUBLE'
,
'count'
:
1
},{
'type'
:
'BINARY'
,
'len'
:
32
,
'count'
:
1
},{
'type'
:
'NCHAR'
,
'len'
:
32
,
'count'
:
1
},{
'type'
:
'TIMESTAMP'
,
'count'
:
1
}],
'tagSchema'
:
[{
'type'
:
'INT'
,
'count'
:
1
},{
'type'
:
'BIGINT'
,
'count'
:
1
},{
'type'
:
'DOUBLE'
,
'count'
:
1
},{
'type'
:
'BINARY'
,
'len'
:
32
,
'count'
:
1
},{
'type'
:
'NCHAR'
,
'len'
:
32
,
'count'
:
1
}],
'ctbPrefix'
:
'ctb'
,
'ctbStartIdx'
:
0
,
'ctbNum'
:
10
,
'rowsPerTbl'
:
10
,
'batchNum'
:
10
,
'startTs'
:
1640966400000
,
# 2022-01-01 00:00:00.000
'pollDelay'
:
3
,
'showMsg'
:
1
,
'showRow'
:
1
,
'snapshot'
:
1
}
paraDict
[
'vgroups'
]
=
self
.
vgroups
paraDict
[
'ctbNum'
]
=
self
.
ctbNum
paraDict
[
'rowsPerTbl'
]
=
self
.
rowsPerTbl
queryString
=
"select * from %s.%s"
%
(
paraDict
[
'dbName'
],
paraDict
[
'stbName'
])
totalTopicNum
=
0
topicName
=
'a'
sqlString
=
"create topic %s as %s"
%
(
topicName
,
queryString
)
tdLog
.
info
(
"create topic sql: %s"
%
sqlString
)
tdSql
.
query
(
sqlString
)
totalTopicNum
+=
1
topicName
=
'3'
sqlString
=
"create topic %s as %s"
%
(
topicName
,
queryString
)
tdLog
.
info
(
"create topic sql: %s"
%
sqlString
)
tdSql
.
error
(
sqlString
)
totalTopicNum
+=
0
topicName
=
'_1'
sqlString
=
"create topic %s as %s"
%
(
topicName
,
queryString
)
tdLog
.
info
(
"create topic sql: %s"
%
sqlString
)
tdSql
.
query
(
sqlString
)
totalTopicNum
+=
1
topicName
=
'a
\\
'
sqlString
=
"create topic %s as %s"
%
(
topicName
,
queryString
)
tdLog
.
info
(
"create topic sql: %s"
%
sqlString
)
tdSql
.
error
(
sqlString
)
totalTopicNum
+=
0
topicName
=
'a\*\&\^'
sqlString
=
"create topic %s as %s"
%
(
topicName
,
queryString
)
tdLog
.
info
(
"create topic sql: %s"
%
sqlString
)
tdSql
.
error
(
sqlString
)
totalTopicNum
+=
0
str191char
=
'a'
for
i
in
range
(
190
):
str191char
=
(
'%s%d'
%
(
str191char
,
1
))
topicName
=
str191char
+
'a'
if
(
192
!=
len
(
topicName
)):
tdLog
.
exit
(
"topicName len error"
)
sqlString
=
"create topic %s as %s"
%
(
topicName
,
queryString
)
tdLog
.
info
(
"create topic sql: %s"
%
sqlString
)
tdSql
.
query
(
sqlString
)
totalTopicNum
+=
1
topicName
=
str191char
+
'12'
sqlString
=
"create topic %s as %s"
%
(
topicName
,
queryString
)
tdLog
.
info
(
"create topic sql: %s"
%
sqlString
)
tdSql
.
error
(
sqlString
)
totalTopicNum
+=
0
# topicName = str192char + '12'
# sqlString = "create topic %s as %s" %(topicName, queryString)
# tdLog.info("create topic sql: %s"%sqlString)
# tdSql.error(sqlString)
# totalTopicNum += 0
# check topic count
tdSql
.
query
(
'show topics;'
)
topicNum
=
tdSql
.
queryRows
tdLog
.
info
(
" topic count: %d"
%
(
topicNum
))
if
topicNum
!=
totalTopicNum
:
tdLog
.
exit
(
"show topics %d not equal expect num: %d"
%
(
topicNum
,
totalTopicNum
))
tdLog
.
printNoPrefix
(
"======== test case 2 end ...... "
)
def
run
(
self
):
self
.
prepareTestEnv
()
self
.
tmqCase1
()
self
.
tmqCase2
()
def
stop
(
self
):
tdSql
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录