Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
f01aa040
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看板
未验证
提交
f01aa040
编写于
6月 08, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
6月 08, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2193 from taosdata/feature/sangshuduo/multi-thread-random-test
fix delete_datafiles issue.
上级
b8b5315b
49eeb2ab
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
19 deletion
+34
-19
tests/pytest/random-test/random-test-multi-threading-3.py
tests/pytest/random-test/random-test-multi-threading-3.py
+1
-1
tests/pytest/random-test/random-test-multi-threading.py
tests/pytest/random-test/random-test-multi-threading.py
+1
-1
tests/pytest/stream/stream1.py
tests/pytest/stream/stream1.py
+17
-8
tests/pytest/stream/stream2.py
tests/pytest/stream/stream2.py
+15
-9
未找到文件。
tests/pytest/random-test/random-test-multi-threading-3.py
浏览文件 @
f01aa040
...
@@ -205,7 +205,7 @@ class Test (Thread):
...
@@ -205,7 +205,7 @@ class Test (Thread):
global
written
global
written
dnodesDir
=
tdDnodes
.
getDnodesRootDir
()
dnodesDir
=
tdDnodes
.
getDnodesRootDir
()
dataDir
=
dnodesDir
+
'/dnode1/*'
dataDir
=
dnodesDir
+
'/dnode1/
data/
*'
deleteCmd
=
'rm -rf %s'
%
dataDir
deleteCmd
=
'rm -rf %s'
%
dataDir
os
.
system
(
deleteCmd
)
os
.
system
(
deleteCmd
)
...
...
tests/pytest/random-test/random-test-multi-threading.py
浏览文件 @
f01aa040
...
@@ -208,7 +208,7 @@ class Test (threading.Thread):
...
@@ -208,7 +208,7 @@ class Test (threading.Thread):
global
written
global
written
dnodesDir
=
tdDnodes
.
getDnodesRootDir
()
dnodesDir
=
tdDnodes
.
getDnodesRootDir
()
dataDir
=
dnodesDir
+
'/dnode1/*'
dataDir
=
dnodesDir
+
'/dnode1/
data/
*'
deleteCmd
=
'rm -rf %s'
%
dataDir
deleteCmd
=
'rm -rf %s'
%
dataDir
os
.
system
(
deleteCmd
)
os
.
system
(
deleteCmd
)
...
...
tests/pytest/stream/stream1.py
浏览文件 @
f01aa040
...
@@ -31,21 +31,26 @@ class TDTestCase:
...
@@ -31,21 +31,26 @@ class TDTestCase:
tdSql
.
prepare
()
tdSql
.
prepare
()
tdLog
.
info
(
"===== step1 ====="
)
tdLog
.
info
(
"===== step1 ====="
)
tdSql
.
execute
(
"create table stb0(ts timestamp, col1 int, col2 float) tags(tgcol int)"
)
tdSql
.
execute
(
"create table stb0(ts timestamp, col1 int, col2 float) tags(tgcol int)"
)
for
i
in
range
(
tbNum
):
for
i
in
range
(
tbNum
):
tdSql
.
execute
(
"create table tb%d using stb0 tags(%d)"
%
(
i
,
i
))
tdSql
.
execute
(
"create table tb%d using stb0 tags(%d)"
%
(
i
,
i
))
for
j
in
range
(
rowNum
):
for
j
in
range
(
rowNum
):
tdSql
.
execute
(
"insert into tb%d values (now - %dm, %d, %d)"
%
(
i
,
1440
-
j
,
j
,
j
))
tdSql
.
execute
(
"insert into tb%d values (now - %dm, %d, %d)"
%
(
i
,
1440
-
j
,
j
,
j
))
time
.
sleep
(
0.1
)
time
.
sleep
(
0.1
)
tdLog
.
info
(
"===== step2 ====="
)
tdLog
.
info
(
"===== step2 ====="
)
tdSql
.
query
(
"select count(*), count(col1), count(col2) from tb0 interval(1d)"
)
tdSql
.
query
(
"select count(*), count(col1), count(col2) from tb0 interval(1d)"
)
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
)
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
checkRows
(
tbNum
)
tdSql
.
checkRows
(
tbNum
)
tdSql
.
execute
(
"create table s0 as select count(*), count(col1), count(col2) from tb0 interval(1d)"
)
tdSql
.
execute
(
"create table s0 as select count(*), count(col1), count(col2) from tb0 interval(1d)"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
checkRows
(
tbNum
+
1
)
tdSql
.
checkRows
(
tbNum
+
1
)
...
@@ -67,7 +72,8 @@ class TDTestCase:
...
@@ -67,7 +72,8 @@ class TDTestCase:
tdLog
.
info
(
"===== step6 ====="
)
tdLog
.
info
(
"===== step6 ====="
)
time
.
sleep
(
0.1
)
time
.
sleep
(
0.1
)
tdSql
.
execute
(
"create table s0 as select count(*), count(col1), count(col2) from tb0 interval(1d)"
)
tdSql
.
execute
(
"create table s0 as select count(*), count(col1), count(col2) from tb0 interval(1d)"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
checkRows
(
tbNum
+
1
)
tdSql
.
checkRows
(
tbNum
+
1
)
...
@@ -81,14 +87,16 @@ class TDTestCase:
...
@@ -81,14 +87,16 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
3
,
rowNum
)
tdSql
.
checkData
(
0
,
3
,
rowNum
)
tdLog
.
info
(
"===== step8 ====="
)
tdLog
.
info
(
"===== step8 ====="
)
tdSql
.
query
(
"select count(*), count(col1), count(col2) from stb0 interval(1d)"
)
tdSql
.
query
(
"select count(*), count(col1), count(col2) from stb0 interval(1d)"
)
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
)
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
checkRows
(
tbNum
+
1
)
tdSql
.
checkRows
(
tbNum
+
1
)
tdSql
.
execute
(
"create table s1 as select count(*), count(col1), count(col2) from stb0 interval(1d)"
)
tdSql
.
execute
(
"create table s1 as select count(*), count(col1), count(col2) from stb0 interval(1d)"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
checkRows
(
tbNum
+
2
)
tdSql
.
checkRows
(
tbNum
+
2
)
...
@@ -110,7 +118,8 @@ class TDTestCase:
...
@@ -110,7 +118,8 @@ class TDTestCase:
tdSql
.
error
(
"select * from s1"
)
tdSql
.
error
(
"select * from s1"
)
tdLog
.
info
(
"===== step12 ====="
)
tdLog
.
info
(
"===== step12 ====="
)
tdSql
.
execute
(
"create table s1 as select count(*), count(col1), count(col2) from stb0 interval(1d)"
)
tdSql
.
execute
(
"create table s1 as select count(*), count(col1), count(col2) from stb0 interval(1d)"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
checkRows
(
tbNum
+
2
)
tdSql
.
checkRows
(
tbNum
+
2
)
...
...
tests/pytest/stream/stream2.py
浏览文件 @
f01aa040
...
@@ -24,7 +24,6 @@ class TDTestCase:
...
@@ -24,7 +24,6 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
run
(
self
):
def
run
(
self
):
tbNum
=
10
tbNum
=
10
rowNum
=
20
rowNum
=
20
...
@@ -33,11 +32,14 @@ class TDTestCase:
...
@@ -33,11 +32,14 @@ class TDTestCase:
tdSql
.
prepare
()
tdSql
.
prepare
()
tdLog
.
info
(
"===== step1 ====="
)
tdLog
.
info
(
"===== step1 ====="
)
tdSql
.
execute
(
"create table stb0(ts timestamp, col1 int, col2 float) tags(tgcol int)"
)
tdSql
.
execute
(
"create table stb0(ts timestamp, col1 int, col2 float) tags(tgcol int)"
)
for
i
in
range
(
tbNum
):
for
i
in
range
(
tbNum
):
tdSql
.
execute
(
"create table tb%d using stb0 tags(%d)"
%
(
i
,
i
))
tdSql
.
execute
(
"create table tb%d using stb0 tags(%d)"
%
(
i
,
i
))
for
j
in
range
(
rowNum
):
for
j
in
range
(
rowNum
):
tdSql
.
execute
(
"insert into tb%d values (now - %dm, %d, %d)"
%
(
i
,
1440
-
j
,
j
,
j
))
tdSql
.
execute
(
"insert into tb%d values (now - %dm, %d, %d)"
%
(
i
,
1440
-
j
,
j
,
j
))
time
.
sleep
(
0.1
)
time
.
sleep
(
0.1
)
tdLog
.
info
(
"===== step2 ====="
)
tdLog
.
info
(
"===== step2 ====="
)
...
@@ -45,7 +47,8 @@ class TDTestCase:
...
@@ -45,7 +47,8 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
1
,
rowNum
)
tdSql
.
checkData
(
0
,
1
,
rowNum
)
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
checkRows
(
tbNum
)
tdSql
.
checkRows
(
tbNum
)
tdSql
.
execute
(
"create table s0 as select count(col1) from tb0 interval(1d)"
)
tdSql
.
execute
(
"create table s0 as select count(col1) from tb0 interval(1d)"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
checkRows
(
tbNum
+
1
)
tdSql
.
checkRows
(
tbNum
+
1
)
...
@@ -63,7 +66,8 @@ class TDTestCase:
...
@@ -63,7 +66,8 @@ class TDTestCase:
tdSql
.
error
(
"select * from s0"
)
tdSql
.
error
(
"select * from s0"
)
tdLog
.
info
(
"===== step6 ====="
)
tdLog
.
info
(
"===== step6 ====="
)
tdSql
.
execute
(
"create table s0 as select count(*), count(col1), count(col2) from tb0 interval(1d)"
)
tdSql
.
execute
(
"create table s0 as select count(*), count(col1), count(col2) from tb0 interval(1d)"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
checkRows
(
tbNum
+
1
)
tdSql
.
checkRows
(
tbNum
+
1
)
...
@@ -75,13 +79,15 @@ class TDTestCase:
...
@@ -75,13 +79,15 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
3
,
rowNum
)
tdSql
.
checkData
(
0
,
3
,
rowNum
)
tdLog
.
info
(
"===== step8 ====="
)
tdLog
.
info
(
"===== step8 ====="
)
tdSql
.
query
(
"select count(*), count(col1), count(col2) from stb0 interval(1d)"
)
tdSql
.
query
(
"select count(*), count(col1), count(col2) from stb0 interval(1d)"
)
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
)
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
checkRows
(
tbNum
+
1
)
tdSql
.
checkRows
(
tbNum
+
1
)
tdSql
.
execute
(
"create table s1 as select count(*), count(col1), count(col2) from stb0 interval(1d)"
)
tdSql
.
execute
(
"create table s1 as select count(*), count(col1), count(col2) from stb0 interval(1d)"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
checkRows
(
tbNum
+
2
)
tdSql
.
checkRows
(
tbNum
+
2
)
...
@@ -101,7 +107,8 @@ class TDTestCase:
...
@@ -101,7 +107,8 @@ class TDTestCase:
tdSql
.
error
(
"select * from s1"
)
tdSql
.
error
(
"select * from s1"
)
tdLog
.
info
(
"===== step12 ====="
)
tdLog
.
info
(
"===== step12 ====="
)
tdSql
.
execute
(
"create table s1 as select count(col1) from stb0 interval(1d)"
)
tdSql
.
execute
(
"create table s1 as select count(col1) from stb0 interval(1d)"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
checkRows
(
tbNum
+
2
)
tdSql
.
checkRows
(
tbNum
+
2
)
...
@@ -112,7 +119,6 @@ class TDTestCase:
...
@@ -112,7 +119,6 @@ class TDTestCase:
#tdSql.checkData(0, 2, None)
#tdSql.checkData(0, 2, None)
#tdSql.checkData(0, 3, None)
#tdSql.checkData(0, 3, None)
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录