Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
99899103
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看板
提交
99899103
编写于
6月 22, 2020
作者:
S
Shuduo Sang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix stream/stream pytest.
上级
2c3afd83
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
69 addition
and
29 deletion
+69
-29
tests/pytest/stream/stream1.py
tests/pytest/stream/stream1.py
+25
-12
tests/pytest/stream/stream2.py
tests/pytest/stream/stream2.py
+44
-17
未找到文件。
tests/pytest/stream/stream1.py
浏览文件 @
99899103
...
@@ -58,9 +58,13 @@ class TDTestCase:
...
@@ -58,9 +58,13 @@ class TDTestCase:
tdLog
.
info
(
"sleeping 120 seconds"
)
tdLog
.
info
(
"sleeping 120 seconds"
)
time
.
sleep
(
120
)
time
.
sleep
(
120
)
tdSql
.
query
(
"select * from s0"
)
tdSql
.
query
(
"select * from s0"
)
try
:
tdSql
.
checkData
(
0
,
1
,
rowNum
)
tdSql
.
checkData
(
0
,
1
,
rowNum
)
tdSql
.
checkData
(
0
,
2
,
rowNum
)
tdSql
.
checkData
(
0
,
2
,
rowNum
)
tdSql
.
checkData
(
0
,
3
,
rowNum
)
tdSql
.
checkData
(
0
,
3
,
rowNum
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
info
(
"===== step4 ====="
)
tdLog
.
info
(
"===== step4 ====="
)
tdSql
.
execute
(
"drop table s0"
)
tdSql
.
execute
(
"drop table s0"
)
...
@@ -82,9 +86,12 @@ class TDTestCase:
...
@@ -82,9 +86,12 @@ class TDTestCase:
time
.
sleep
(
120
)
time
.
sleep
(
120
)
tdSql
.
query
(
"select * from s0"
)
tdSql
.
query
(
"select * from s0"
)
try
:
tdSql
.
checkData
(
0
,
1
,
rowNum
)
tdSql
.
checkData
(
0
,
1
,
rowNum
)
tdSql
.
checkData
(
0
,
2
,
rowNum
)
tdSql
.
checkData
(
0
,
2
,
rowNum
)
tdSql
.
checkData
(
0
,
3
,
rowNum
)
tdSql
.
checkData
(
0
,
3
,
rowNum
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
info
(
"===== step8 ====="
)
tdLog
.
info
(
"===== step8 ====="
)
tdSql
.
query
(
tdSql
.
query
(
...
@@ -105,9 +112,12 @@ class TDTestCase:
...
@@ -105,9 +112,12 @@ class TDTestCase:
time
.
sleep
(
120
)
time
.
sleep
(
120
)
tdSql
.
query
(
"select * from s1"
)
tdSql
.
query
(
"select * from s1"
)
try
:
tdSql
.
checkData
(
0
,
1
,
rowNum
*
tbNum
)
tdSql
.
checkData
(
0
,
1
,
rowNum
*
tbNum
)
tdSql
.
checkData
(
0
,
2
,
rowNum
*
tbNum
)
tdSql
.
checkData
(
0
,
2
,
rowNum
*
tbNum
)
tdSql
.
checkData
(
0
,
3
,
rowNum
*
tbNum
)
tdSql
.
checkData
(
0
,
3
,
rowNum
*
tbNum
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
info
(
"===== step10 ====="
)
tdLog
.
info
(
"===== step10 ====="
)
tdSql
.
execute
(
"drop table s1"
)
tdSql
.
execute
(
"drop table s1"
)
...
@@ -127,9 +137,12 @@ class TDTestCase:
...
@@ -127,9 +137,12 @@ class TDTestCase:
tdLog
.
info
(
"sleeping 120 seconds"
)
tdLog
.
info
(
"sleeping 120 seconds"
)
time
.
sleep
(
120
)
time
.
sleep
(
120
)
tdSql
.
query
(
"select * from s1"
)
tdSql
.
query
(
"select * from s1"
)
try
:
tdSql
.
checkData
(
0
,
1
,
rowNum
*
tbNum
)
tdSql
.
checkData
(
0
,
1
,
rowNum
*
tbNum
)
tdSql
.
checkData
(
0
,
2
,
rowNum
*
tbNum
)
tdSql
.
checkData
(
0
,
2
,
rowNum
*
tbNum
)
tdSql
.
checkData
(
0
,
3
,
rowNum
*
tbNum
)
tdSql
.
checkData
(
0
,
3
,
rowNum
*
tbNum
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
...
...
tests/pytest/stream/stream2.py
浏览文件 @
99899103
...
@@ -55,12 +55,18 @@ class TDTestCase:
...
@@ -55,12 +55,18 @@ class TDTestCase:
tdLog
.
info
(
"===== step3 ====="
)
tdLog
.
info
(
"===== step3 ====="
)
time
.
sleep
(
120
)
time
.
sleep
(
120
)
tdSql
.
query
(
"select * from s0"
)
tdSql
.
query
(
"select * from s0"
)
try
:
tdSql
.
checkData
(
0
,
1
,
rowNum
)
tdSql
.
checkData
(
0
,
1
,
rowNum
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
info
(
"===== step4 ====="
)
tdLog
.
info
(
"===== step4 ====="
)
tdSql
.
execute
(
"drop table s0"
)
tdSql
.
execute
(
"drop table s0"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
try
:
tdSql
.
checkRows
(
tbNum
)
tdSql
.
checkRows
(
tbNum
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
info
(
"===== step5 ====="
)
tdLog
.
info
(
"===== step5 ====="
)
tdSql
.
error
(
"select * from s0"
)
tdSql
.
error
(
"select * from s0"
)
...
@@ -69,21 +75,30 @@ class TDTestCase:
...
@@ -69,21 +75,30 @@ class TDTestCase:
tdSql
.
execute
(
tdSql
.
execute
(
"create table s0 as select count(*), count(col1), count(col2) from tb0 interval(1d)"
)
"create table s0 as select count(*), count(col1), count(col2) from tb0 interval(1d)"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
try
:
tdSql
.
checkRows
(
tbNum
+
1
)
tdSql
.
checkRows
(
tbNum
+
1
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
info
(
"===== step7 ====="
)
tdLog
.
info
(
"===== step7 ====="
)
time
.
sleep
(
120
)
time
.
sleep
(
120
)
tdSql
.
query
(
"select * from s0"
)
tdSql
.
query
(
"select * from s0"
)
try
:
tdSql
.
checkData
(
0
,
1
,
rowNum
)
tdSql
.
checkData
(
0
,
1
,
rowNum
)
tdSql
.
checkData
(
0
,
2
,
rowNum
)
tdSql
.
checkData
(
0
,
2
,
rowNum
)
tdSql
.
checkData
(
0
,
3
,
rowNum
)
tdSql
.
checkData
(
0
,
3
,
rowNum
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
info
(
"===== step8 ====="
)
tdLog
.
info
(
"===== step8 ====="
)
tdSql
.
query
(
tdSql
.
query
(
"select count(*), count(col1), count(col2) from stb0 interval(1d)"
)
"select count(*), count(col1), count(col2) from stb0 interval(1d)"
)
try
:
tdSql
.
checkData
(
0
,
1
,
totalNum
)
tdSql
.
checkData
(
0
,
1
,
totalNum
)
tdSql
.
checkData
(
0
,
2
,
totalNum
)
tdSql
.
checkData
(
0
,
2
,
totalNum
)
tdSql
.
checkData
(
0
,
3
,
totalNum
)
tdSql
.
checkData
(
0
,
3
,
totalNum
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
checkRows
(
tbNum
+
1
)
tdSql
.
checkRows
(
tbNum
+
1
)
tdSql
.
execute
(
tdSql
.
execute
(
...
@@ -94,14 +109,20 @@ class TDTestCase:
...
@@ -94,14 +109,20 @@ class TDTestCase:
tdLog
.
info
(
"===== step9 ====="
)
tdLog
.
info
(
"===== step9 ====="
)
time
.
sleep
(
120
)
time
.
sleep
(
120
)
tdSql
.
query
(
"select * from s1"
)
tdSql
.
query
(
"select * from s1"
)
try
:
tdSql
.
checkData
(
0
,
1
,
totalNum
)
tdSql
.
checkData
(
0
,
1
,
totalNum
)
tdSql
.
checkData
(
0
,
2
,
totalNum
)
tdSql
.
checkData
(
0
,
2
,
totalNum
)
tdSql
.
checkData
(
0
,
3
,
totalNum
)
tdSql
.
checkData
(
0
,
3
,
totalNum
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
info
(
"===== step10 ====="
)
tdLog
.
info
(
"===== step10 ====="
)
tdSql
.
execute
(
"drop table s1"
)
tdSql
.
execute
(
"drop table s1"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
try
:
tdSql
.
checkRows
(
tbNum
+
1
)
tdSql
.
checkRows
(
tbNum
+
1
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
info
(
"===== step11 ====="
)
tdLog
.
info
(
"===== step11 ====="
)
tdSql
.
error
(
"select * from s1"
)
tdSql
.
error
(
"select * from s1"
)
...
@@ -110,14 +131,20 @@ class TDTestCase:
...
@@ -110,14 +131,20 @@ class TDTestCase:
tdSql
.
execute
(
tdSql
.
execute
(
"create table s1 as select count(col1) from stb0 interval(1d)"
)
"create table s1 as select count(col1) from stb0 interval(1d)"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
try
:
tdSql
.
checkRows
(
tbNum
+
2
)
tdSql
.
checkRows
(
tbNum
+
2
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
info
(
"===== step13 ====="
)
tdLog
.
info
(
"===== step13 ====="
)
time
.
sleep
(
120
)
time
.
sleep
(
120
)
tdSql
.
query
(
"select * from s1"
)
tdSql
.
query
(
"select * from s1"
)
try
:
tdSql
.
checkData
(
0
,
1
,
totalNum
)
tdSql
.
checkData
(
0
,
1
,
totalNum
)
#tdSql.checkData(0, 2, None)
#tdSql.checkData(0, 2, None)
#tdSql.checkData(0, 3, None)
#tdSql.checkData(0, 3, None)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录