Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
5ad7b265
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
5ad7b265
编写于
6月 05, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
6月 05, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2144 from taosdata/feature/sangshuduo/multi-thread-random-test
few variables need reset after prepare called.
上级
cd8aef28
ab471332
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
38 addition
and
33 deletion
+38
-33
tests/pytest/query/filter.py
tests/pytest/query/filter.py
+2
-2
tests/pytest/query/filterCombo.py
tests/pytest/query/filterCombo.py
+6
-3
tests/pytest/query/queryError.py
tests/pytest/query/queryError.py
+4
-5
tests/pytest/query/queryNormal.py
tests/pytest/query/queryNormal.py
+15
-12
tests/pytest/random-test/random-test-multi-threading-3.py
tests/pytest/random-test/random-test-multi-threading-3.py
+1
-4
tests/pytest/random-test/random-test-multi-threading.py
tests/pytest/random-test/random-test-multi-threading.py
+1
-4
tests/pytest/random-test/random-test.py
tests/pytest/random-test/random-test.py
+9
-3
未找到文件。
tests/pytest/query/filter.py
浏览文件 @
5ad7b265
...
...
@@ -87,7 +87,7 @@ class TDTestCase:
# <> for timestamp type
tdSql
.
query
(
"select * from db.st where ts <> '2020-05-13 10:00:00.002'"
)
#tdSql.checkRows(4)
#
tdSql.checkRows(4)
# <> for numeric type
tdSql
.
query
(
"select * from db.st where tagtype <> 2"
)
...
...
tests/pytest/query/filterCombo.py
浏览文件 @
5ad7b265
...
...
@@ -42,14 +42,17 @@ class TDTestCase:
('2020-05-13 10:00:00.005', 3, 'third')"""
)
# query with filter condition A OR condition B
tdSql
.
query
(
"select * from db.st where ts > '2020-05-13 10:00:00.002' AND tagtype < 2"
)
tdSql
.
query
(
"select * from db.st where ts > '2020-05-13 10:00:00.002' AND tagtype < 2"
)
tdSql
.
checkRows
(
1
)
# query with filter condition A OR condition B, error expected
tdSql
.
error
(
"select * from db.st where ts > '2020-05-13 10:00:00.002' OR tagtype < 2"
)
tdSql
.
error
(
"select * from db.st where ts > '2020-05-13 10:00:00.002' OR tagtype < 2"
)
# illegal condition
tdSql
.
error
(
"select * from db.st where ts != '2020-05-13 10:00:00.002' OR tagtype < 2"
)
tdSql
.
error
(
"select * from db.st where ts != '2020-05-13 10:00:00.002' OR tagtype < 2"
)
tdSql
.
error
(
"select * from db.st where tagtype <> 1 OR tagtype < 2"
)
def
stop
(
self
):
...
...
tests/pytest/query/queryError.py
浏览文件 @
5ad7b265
...
...
@@ -41,7 +41,6 @@ class TDTestCase:
('2020-05-13 10:00:00.002', 3, 'third') dev_002 VALUES('2020-05-13 10:00:00.003', 1, 'first'), ('2020-05-13 10:00:00.004', 2, 'second'),
('2020-05-13 10:00:00.005', 3, 'third')"""
)
# query first .. as ..
tdSql
.
error
(
"select first(*) as one from st"
)
...
...
tests/pytest/query/queryNormal.py
浏览文件 @
5ad7b265
...
...
@@ -28,9 +28,12 @@ class TDTestCase:
print
(
"==============step1"
)
tdSql
.
execute
(
"create table stb1 (ts timestamp, c1 int, c2 float) tags(t1 int, t2 binary(10), t3 nchar(10))"
)
tdSql
.
execute
(
"insert into tb1 using stb1 tags(1,'tb1', '表1') values ('2020-04-18 15:00:00.000', 1, 0.1), ('2020-04-18 15:00:01.000', 2, 0.1)"
)
tdSql
.
execute
(
"insert into tb2 using stb1 tags(2,'tb2', '表2') values ('2020-04-18 15:00:02.000', 3, 2.1), ('2020-04-18 15:00:03.000', 4, 2.2)"
)
tdSql
.
execute
(
"create table stb1 (ts timestamp, c1 int, c2 float) tags(t1 int, t2 binary(10), t3 nchar(10))"
)
tdSql
.
execute
(
"insert into tb1 using stb1 tags(1,'tb1', '表1') values ('2020-04-18 15:00:00.000', 1, 0.1), ('2020-04-18 15:00:01.000', 2, 0.1)"
)
tdSql
.
execute
(
"insert into tb2 using stb1 tags(2,'tb2', '表2') values ('2020-04-18 15:00:02.000', 3, 2.1), ('2020-04-18 15:00:03.000', 4, 2.2)"
)
# inner join --- bug
tdSql
.
query
(
"select * from tb1 a, tb2 b where a.ts = b.ts"
)
...
...
tests/pytest/random-test/random-test-multi-threading-3.py
浏览文件 @
5ad7b265
...
...
@@ -111,7 +111,6 @@ class Test (threading.Thread):
last_tb
)
written
=
written
+
1
def
drop_stable
(
self
):
tdLog
.
info
(
"drop_stable"
)
global
last_stb
...
...
@@ -152,7 +151,6 @@ class Test (threading.Thread):
last_tb
=
""
written
=
0
def
query_data_from_stable
(
self
):
tdLog
.
info
(
"query_data_from_stable"
)
global
last_stb
...
...
@@ -164,7 +162,6 @@ class Test (threading.Thread):
tdLog
.
info
(
"will query data from super table"
)
tdSql
.
execute
(
'select * from %s'
%
last_stb
)
def
reset_query_cache
(
self
):
tdLog
.
info
(
"reset_query_cache"
)
global
last_tb
...
...
@@ -232,7 +229,7 @@ class Test (threading.Thread):
self
.
threadLock
.
acquire
()
tdLog
.
notice
(
"first thread"
)
randDataOp
=
random
.
randint
(
1
,
3
)
dataOp
.
get
(
randDataOp
,
lambda
:
"ERROR"
)()
dataOp
.
get
(
randDataOp
,
lambda
:
"ERROR"
)()
self
.
threadLock
.
release
()
elif
(
self
.
threadId
==
2
):
...
...
tests/pytest/random-test/random-test-multi-threading.py
浏览文件 @
5ad7b265
...
...
@@ -111,7 +111,6 @@ class Test (threading.Thread):
last_tb
)
written
=
written
+
1
def
drop_stable
(
self
):
tdLog
.
info
(
"drop_stable"
)
global
last_stb
...
...
@@ -154,7 +153,6 @@ class Test (threading.Thread):
last_tb
=
""
written
=
0
def
query_data_from_stable
(
self
):
tdLog
.
info
(
"query_data_from_stable"
)
global
last_stb
...
...
@@ -166,7 +164,6 @@ class Test (threading.Thread):
tdLog
.
info
(
"will query data from super table"
)
tdSql
.
execute
(
'select * from %s'
%
last_stb
)
def
reset_query_cache
(
self
):
tdLog
.
info
(
"reset_query_cache"
)
global
last_tb
...
...
@@ -230,7 +227,7 @@ class Test (threading.Thread):
self
.
threadLock
.
acquire
()
tdLog
.
notice
(
"first thread"
)
randDataOp
=
random
.
randint
(
1
,
3
)
dataOp
.
get
(
randDataOp
,
lambda
:
"ERROR"
)()
dataOp
.
get
(
randDataOp
,
lambda
:
"ERROR"
)()
self
.
threadLock
.
release
()
elif
(
self
.
threadId
==
2
):
...
...
tests/pytest/random-test/random-test.py
浏览文件 @
5ad7b265
...
...
@@ -112,7 +112,6 @@ class Test:
tdSql
.
execute
(
'drop table %s'
%
self
.
last_stb
)
self
.
last_stb
=
""
def
query_data_from_stable
(
self
):
tdLog
.
info
(
"query_data_from_stable"
)
if
(
self
.
last_stb
==
""
):
...
...
@@ -122,20 +121,21 @@ class Test:
tdLog
.
info
(
"will query data from super table"
)
tdSql
.
execute
(
'select * from %s'
%
self
.
last_stb
)
def
restart_database
(
self
):
tdLog
.
info
(
"restart_databae"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
5
)
def
force_restart_database
(
self
):
tdLog
.
info
(
"force_restart_database"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
5
)
tdSql
.
prepare
()
self
.
last_tb
=
""
self
.
last_stb
=
""
self
.
written
=
0
def
drop_table
(
self
):
tdLog
.
info
(
"drop_table"
)
...
...
@@ -159,6 +159,9 @@ class Test:
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
5
)
tdSql
.
prepare
()
self
.
last_tb
=
""
self
.
last_stb
=
""
self
.
written
=
0
def
delete_datafiles
(
self
):
tdLog
.
info
(
"delete_datafiles"
)
...
...
@@ -173,6 +176,9 @@ class Test:
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
tdSql
.
prepare
()
self
.
last_tb
=
""
self
.
last_stb
=
""
self
.
written
=
0
class
TDTestCase
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录