Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2c7a9137
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看板
提交
2c7a9137
编写于
10月 21, 2020
作者:
L
liuyq-617
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<test> modify test case
上级
69cc4e49
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
94 addition
and
76 deletion
+94
-76
Jenkinsfile
Jenkinsfile
+16
-0
tests/pytest/concurrent_inquiry.py
tests/pytest/concurrent_inquiry.py
+78
-76
未找到文件。
Jenkinsfile
浏览文件 @
2c7a9137
...
...
@@ -118,6 +118,22 @@ pipeline {
date'''
}
}
stage
(
'connector'
){
agent
{
label
"release"
}
steps
{
sh
'''
cd ${WORKSPACE}
git checkout develop
cd tests/gotest
bash batchtest.sh
cd ${WORKSPACE}/tests/examples/JDBC/JDBCDemo/
mvn clean package assembly:single >/dev/null
java -jar target/jdbcChecker-SNAPSHOT-jar-with-dependencies.jar -host 127.0.0.1
cd ${WORKSPACE}/tests/examples/python/PYTHONConnectorChecker
python3 PythonChecker.py
'''
}
}
}
}
...
...
tests/pytest/concurrent_inquiry.py
浏览文件 @
2c7a9137
...
...
@@ -12,108 +12,105 @@
# -*- coding: utf-8 -*-
import
threading
import
taos
import
sys
import
json
import
time
import
random
# query sql
query_sql
=
[
# first supertable
"select count(*) from test.meters where c1 > 50;"
,
"select count(*) from test.meters where c2 >= 50 and c2 < 100;"
,
"select count(*) from test.meters where c3 != 5;"
,
"select count(*) from test.meters ;"
,
"select count(*) from test.meters where t3 > 2;"
,
"select count(*) from test.meters where ts <> '2020-05-13 10:00:00.002';"
,
"select count(*) from test.meters where t7 like 'fi%';"
,
"select count(*) from test.meters where t7 like '_econd';"
,
"select count(*) from test.meters where t7 like 'taos_1%';"
,
"select count(*) from test.meters where t7 like '_____2';"
,
"select count(*) from test.meters where t8 like '%思%';"
,
"select count(*) from test.meters interval(1n) order by ts desc;"
,
"select max(c0) from test.meters group by tbname"
,
"select first(
*) from test.meters
;"
,
"select last(
*) from test.meters
;"
,
#
"select max(c0) from test.meters group by tbname",
"select first(
ts) from test.meters where t5 >5000 and t5<5100
;"
,
"select last(
ts) from test.meters where t5 >5000 and t5<5100
;"
,
"select last_row(*) from test.meters;"
,
"select twa(c1) from test.t1 where ts > 1500000001000 and ts < 1500000101000"
,
"select avg(c1) from test.meters;"
,
"select avg(c1) from test.meters
where t5 >5000 and t5<5100
;"
,
"select bottom(c1, 2) from test.t1;"
,
"select diff(c1) from test.t1;"
,
"select leastsquares(c1, 1, 1) from test.t1 ;"
,
"select max(c1) from test.meters;"
,
"select min(c1) from test.meters;"
,
"select c1 + c2
* c3
+ c1 / c5 + c4 + c2 from test.t1;"
,
"select max(c1) from test.meters
where t5 >5000 and t5<5100
;"
,
"select min(c1) from test.meters
where t5 >5000 and t5<5100
;"
,
"select c1 + c2 + c1 / c5 + c4 + c2 from test.t1;"
,
"select percentile(c1, 50) from test.t1;"
,
"select spread(c1) from test.t1 ;"
,
"select stddev(c1) from test.t1;"
,
"select sum(c1) from test.meters;"
,
"select top(c1, 2) from test.meters;"
"select twa(c
6
) from test.t1 where ts > 1500000001000 and ts < 1500000101000"
,
"select avg(c
6) from test.meters
;"
,
"select bottom(c
6, 2) from test.t1
;"
,
"select diff(c
6) from test.t1
;"
,
"select leastsquares(c
6
, 1, 1) from test.t1 ;"
,
"select max(c
6) from test.meters
;"
,
"select min(c
6) from test.meters
;"
,
"select c
6 + c2 * c3 + c6 / c5 + c4 + c2 from test.t1
;"
,
"select percentile(c
6
, 50) from test.t1;"
,
"select spread(c
6
) from test.t1 ;"
,
"select stddev(c
6) from test.t1
;"
,
"select sum(c
6) from test.meters
;"
,
"select top(c
6, 2) from test.meters
;"
,
"select sum(c1) from test.meters
where t5 >5000 and t5<5100
;"
,
"select top(c1, 2) from test.meters
where t5 >5000 and t5<5100
;"
"select twa(c
4
) from test.t1 where ts > 1500000001000 and ts < 1500000101000"
,
"select avg(c
4) from test.meters where t5 >5000 and t5<5100
;"
,
"select bottom(c
4, 2) from test.t1 where t5 >5000 and t5<5100
;"
,
"select diff(c
4) from test.t1 where t5 >5000 and t5<5100
;"
,
"select leastsquares(c
4
, 1, 1) from test.t1 ;"
,
"select max(c
4) from test.meters where t5 >5000 and t5<5100
;"
,
"select min(c
4) from test.meters where t5 >5000 and t5<5100
;"
,
"select c
5 + c2 + c4 / c5 + c4 + c2 from test.t1
;"
,
"select percentile(c
5
, 50) from test.t1;"
,
"select spread(c
5
) from test.t1 ;"
,
"select stddev(c
5) from test.t1 where t5 >5000 and t5<5100
;"
,
"select sum(c
5) from test.meters where t5 >5000 and t5<5100
;"
,
"select top(c
5, 2) from test.meters where t5 >5000 and t5<5100
;"
,
#all vnode
"select count(*) from test.meters where t5 >
2500 and t5<75
00"
,
"select max(c0),avg(c1) from test.meters where t5 >
2500 and t5<75
00"
,
"select sum(c5),avg(c1) from test.meters where t5 >
2500 and t5<75
00"
,
"select max(c0),min(c
6) from test.meters where t5 >2500 and t5<75
00"
,
"select min(c0),avg(c
6) from test.meters where t5 >2500 and t5<75
00"
,
"select count(*) from test.meters where t5 >
5000 and t5<51
00"
,
"select max(c0),avg(c1) from test.meters where t5 >
5000 and t5<51
00"
,
"select sum(c5),avg(c1) from test.meters where t5 >
5000 and t5<51
00"
,
"select max(c0),min(c
5) from test.meters where t5 >5000 and t5<51
00"
,
"select min(c0),avg(c
5) from test.meters where t5 >5000 and t5<51
00"
,
# second supertable
"select count(*) from test.meters1 where c1 > 50;"
,
"select count(*) from test.meters1 where c2 >= 50 and c2 < 100;"
,
"select count(*) from test.meters1 where c3 != 5;"
,
"select count(*) from test.meters1 where t3 > 2;"
,
"select count(*) from test.meters1 where ts <> '2020-05-13 10:00:00.002';"
,
"select count(*) from test.meters1 where t7 like 'fi%';"
,
"select count(*) from test.meters1 where t7 like '_econd';"
,
"select count(*) from test.meters where t7 like 'taos_1%';"
,
"select count(*) from test.meters where t7 like '_____2';"
,
"select count(*) from test.meters where t8 like '%思%';"
,
"select count(*) from test.meters1 interval(1n) order by ts desc;"
,
"select max(c0) from test.meters1 group by tbname"
,
"select first(
*) from test.meters1
;"
,
"select last(
*) from test.meters1
;"
,
"select last_row(*) from test.meters1;"
,
#
"select max(c0) from test.meters1 group by tbname",
"select first(
ts) from test.meters1 where t5 >5000 and t5<5100
;"
,
"select last(
ts) from test.meters1 where t5 >5000 and t5<5100
;"
,
"select last_row(*) from test.meters1
;"
,
"select twa(c1) from test.m1 where ts > 1500000001000 and ts < 1500000101000"
,
"select avg(c1) from test.meters1;"
,
"select bottom(c1, 2) from test.m1;"
,
"select diff(c1) from test.m1;"
,
"select avg(c1) from test.meters1
where t5 >5000 and t5<5100
;"
,
"select bottom(c1, 2) from test.m1
where t5 >5000 and t5<5100
;"
,
"select diff(c1) from test.m1
;"
,
"select leastsquares(c1, 1, 1) from test.m1 ;"
,
"select max(c1) from test.meters1;"
,
"select min(c1) from test.meters1;"
,
"select c1 + c2
* c3 + c1 / c5 + c3 + c2 from test.m1
;"
,
"select max(c1) from test.meters1
where t5 >5000 and t5<5100
;"
,
"select min(c1) from test.meters1
where t5 >5000 and t5<5100
;"
,
"select c1 + c2
+ c1 / c0 + c2 from test.m1
;"
,
"select percentile(c1, 50) from test.m1;"
,
"select spread(c1) from test.m1 ;"
,
"select stddev(c1) from test.m1;"
,
"select sum(c1) from test.meters1;"
,
"select top(c1, 2) from test.meters1;"
,
"select twa(c
6
) from test.m1 where ts > 1500000001000 and ts < 1500000101000"
,
"select avg(c
6) from test.meters1
;"
,
"select bottom(c
6
, 2) from test.m1;"
,
"select diff(c
6
) from test.m1;"
,
"select leastsquares(c
6
, 1, 1) from test.m1 ;"
,
"select max(c
6) from test.meters1
;"
,
"select min(c
6) from test.meters1
;"
,
"select c
6 + c2 * c3 + c6 / c5 + c3 + c2
from test.m1;"
,
"select percentile(c
6
, 50) from test.m1;"
,
"select spread(c
6
) from test.m1 ;"
,
"select stddev(c
6
) from test.m1;"
,
"select sum(c
6) from test.meters1
;"
,
"select top(c
6, 2) from test.meters1
;"
,
"select count(*) from test.meters1 where t5 >
2500 and t5<75
00"
,
"select sum(c1) from test.meters1
where t5 >5000 and t5<5100
;"
,
"select top(c1, 2) from test.meters1
where t5 >5000 and t5<5100
;"
,
"select twa(c
5
) from test.m1 where ts > 1500000001000 and ts < 1500000101000"
,
"select avg(c
5) from test.meters1 where t5 >5000 and t5<5100
;"
,
"select bottom(c
5
, 2) from test.m1;"
,
"select diff(c
5
) from test.m1;"
,
"select leastsquares(c
5
, 1, 1) from test.m1 ;"
,
"select max(c
5) from test.meters1 where t5 >5000 and t5<5100
;"
,
"select min(c
5) from test.meters1 where t5 >5000 and t5<5100
;"
,
"select c
5 + c2 + c4 / c5 + c0
from test.m1;"
,
"select percentile(c
4
, 50) from test.m1;"
,
"select spread(c
4
) from test.m1 ;"
,
"select stddev(c
4
) from test.m1;"
,
"select sum(c
4) from test.meters1 where t5 >5100 and t5<5300
;"
,
"select top(c
4, 2) from test.meters1 where t5 >5100 and t5<5300
;"
,
"select count(*) from test.meters1 where t5 >
5100 and t5<53
00"
,
#all vnode
"select count(*) from test.meters1 where t5 >
2500 and t5<75
00"
,
"select max(c0),avg(c1) from test.meters1 where t5 >
2500 and t5<75
00"
,
"select sum(c5),avg(c1) from test.meters1 where t5 >
2500 and t5<75
00"
,
"select max(c0),min(c
6) from test.meters1 where t5 >2500 and t5<75
00"
,
"select min(c0),avg(c
6) from test.meters1 where t5 >2500 and t5<75
00"
,
"select count(*) from test.meters1 where t5 >
5100 and t5<53
00"
,
"select max(c0),avg(c1) from test.meters1 where t5 >
5000 and t5<51
00"
,
"select sum(c5),avg(c1) from test.meters1 where t5 >
5000 and t5<51
00"
,
"select max(c0),min(c
5) from test.meters1 where t5 >5000 and t5<51
00"
,
"select min(c0),avg(c
5) from test.meters1 where t5 >5000 and t5<51
00"
,
#join
"select * from meters,meters1 where meters.ts = meters1.ts and meters.t5 = meters1.t5"
,
"select * from meters,meters1 where meters.ts = meters1.ts and meters.t7 = meters1.t7"
,
"select * from meters,meters1 where meters.ts = meters1.ts and meters.t8 = meters1.t8"
,
"select meters.ts,meters1.c2 from meters,meters1 where meters.ts = meters1.ts and meters.t8 = meters1.t8"
#
"select * from meters,meters1 where meters.ts = meters1.ts and meters.t5 = meters1.t5",
#
"select * from meters,meters1 where meters.ts = meters1.ts and meters.t7 = meters1.t7",
#
"select * from meters,meters1 where meters.ts = meters1.ts and meters.t8 = meters1.t8",
#
"select meters.ts,meters1.c2 from meters,meters1 where meters.ts = meters1.ts and meters.t8 = meters1.t8"
]
class
ConcurrentInquiry
:
...
...
@@ -121,7 +118,8 @@ class ConcurrentInquiry:
self
.
numOfTherads
=
50
self
.
ts
=
1500000001000
def
SetThreadsNum
(
self
,
num
):
self
.
numOfTherads
=
num
def
query_thread
(
self
,
threadID
):
host
=
"10.211.55.14"
user
=
"root"
...
...
@@ -142,12 +140,16 @@ class ConcurrentInquiry:
for
i
in
ran_query_sql
:
print
(
"Thread %d : %s"
%
(
threadID
,
i
))
try
:
start
=
time
.
time
()
cl
.
execute
(
i
)
cl
.
fetchall
end
=
time
.
time
()
print
(
"time cost :"
,
end
-
start
)
except
Exception
as
e
:
print
(
"Failure thread%d, sql: %s,exception: %s"
%
(
threadID
,
str
(
i
),
str
(
e
)))
exit
(
-
1
)
print
(
"Thread %d: finishing"
%
threadID
)
...
...
@@ -155,9 +157,9 @@ class ConcurrentInquiry:
def
run
(
self
):
threads
=
[]
for
i
in
range
(
50
):
for
i
in
range
(
self
.
numOfTherads
):
thread
=
threading
.
Thread
(
target
=
self
.
query_thread
,
args
=
(
i
,))
threads
.
append
(
thread
)
thread
.
start
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录