Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
923234a0
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看板
提交
923234a0
编写于
6月 17, 2021
作者:
haoranc
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of github.com:taosdata/TDengine into dev/chr
上级
0ced96c8
3e928774
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
716 addition
and
33 deletion
+716
-33
tests/pytest/alter/alter_keep.py
tests/pytest/alter/alter_keep.py
+10
-10
tests/pytest/client/change_time_1_1.py
tests/pytest/client/change_time_1_1.py
+22
-6
tests/pytest/client/change_time_1_2.py
tests/pytest/client/change_time_1_2.py
+32
-14
tests/pytest/fulltest.sh
tests/pytest/fulltest.sh
+3
-3
tests/script/api/stmtBatchTest.c
tests/script/api/stmtBatchTest.c
+649
-0
未找到文件。
tests/pytest/alter/alter_keep.py
浏览文件 @
923234a0
...
...
@@ -15,6 +15,7 @@ import sys
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
import
time
class
TDTestCase
:
...
...
@@ -129,9 +130,6 @@ class TDTestCase:
tdSql
.
prepare
()
##TODO: need to wait for TD-4445 to implement the following
## tests
## preset the keep
tdSql
.
prepare
()
...
...
@@ -176,20 +174,22 @@ class TDTestCase:
tdSql
.
error
(
'insert into tb values (now-15d, 10)'
)
tdSql
.
query
(
'select * from tb'
)
tdSql
.
checkRows
(
rowNum
)
tdLog
.
notice
(
'testing keep will be altered if sudden change from small to big'
)
tdSql
.
execute
(
'alter database db keep 14,14,14'
)
tdSql
.
execute
(
'alter database db keep 15,15,15'
)
tdSql
.
execute
(
'insert into tb values (now-15d, 10)'
)
tdSql
.
query
(
'select * from tb'
)
tdSql
.
checkRows
(
rowNum
+
1
)
for
i
in
range
(
30
):
tdSql
.
execute
(
'alter database db keep 14,14,14'
)
tdSql
.
execute
(
'alter database db keep 16,16,16'
)
tdSql
.
execute
(
'insert into tb values (now-15d, 10)'
)
tdSql
.
query
(
'select * from tb'
)
rowNum
+=
1
tdSql
.
checkRows
(
rowNum
)
tdLog
.
notice
(
'testing keep will be altered if sudden change from big to small'
)
tdSql
.
execute
(
'alter database db keep 16,16,16'
)
tdSql
.
execute
(
'alter database db keep 14,14,14'
)
tdSql
.
error
(
'insert into tb values (now-15d, 10)'
)
tdSql
.
query
(
'select * from tb'
)
tdSql
.
checkRows
(
rowNum
+
1
)
tdSql
.
checkRows
(
rowNum
)
...
...
tests/pytest/client/change_time_1_1.py
浏览文件 @
923234a0
...
...
@@ -19,6 +19,7 @@ from util.pathFinding import *
from
util.dnodes
import
tdDnodes
from
datetime
import
datetime
import
subprocess
import
time
##TODO: this is now automatic, but not sure if this will run through jenkins
class
TDTestCase
:
...
...
@@ -34,24 +35,36 @@ class TDTestCase:
## change system time to 2020/10/20
os
.
system
(
'sudo timedatectl set-ntp off'
)
tdLog
.
sleep
(
10
)
os
.
system
(
'sudo timedatectl set-time 2020-10-20'
)
#run taosdemo to insert data. one row per second from 2020/10/11 to 2020/10/20
#11 data files should be generated
#vnode at TDinternal/community/sim/dnode1/data/vnode
os
.
system
(
f
"
{
binPath
}
taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_A.json"
)
commandArray
=
[
'ls'
,
'-l'
,
f
'
{
TDenginePath
}
/sim/dnode1/data/vnode/vnode2/tsdb/data'
]
result
=
subprocess
.
run
(
commandArray
,
stdout
=
subprocess
.
PIPE
).
stdout
.
decode
(
'utf-8'
)
print
(
result
.
count
(
'data'
))
try
:
os
.
system
(
f
"
{
binPath
}
taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_A.json"
)
commandArray
=
[
'ls'
,
'-l'
,
f
'
{
TDenginePath
}
/sim/dnode1/data/vnode/vnode2/tsdb/data'
]
result
=
subprocess
.
run
(
commandArray
,
stdout
=
subprocess
.
PIPE
).
stdout
.
decode
(
'utf-8'
)
except
BaseException
:
os
.
system
(
'sudo timedatectl set-ntp on'
)
tdLog
.
sleep
(
10
)
if
result
.
count
(
'data'
)
!=
11
:
os
.
system
(
'sudo timedatectl set-ntp on'
)
tdLog
.
sleep
(
10
)
tdLog
.
exit
(
'wrong number of files'
)
else
:
tdLog
.
debug
(
"data file number correct"
)
#move 5 days ahead to 2020/10/25. 4 oldest files should be removed during the new write
#leaving 7 data files.
os
.
system
(
'timedatectl set-time 2020-10-25'
)
os
.
system
(
f
"
{
binPath
}
taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_B.json"
)
try
:
os
.
system
(
'timedatectl set-time 2020-10-25'
)
os
.
system
(
f
"
{
binPath
}
taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_B.json"
)
except
BaseException
:
os
.
system
(
'sudo timedatectl set-ntp on'
)
tdLog
.
sleep
(
10
)
os
.
system
(
'sudo timedatectl set-ntp on'
)
tdLog
.
sleep
(
10
)
commandArray
=
[
'ls'
,
'-l'
,
f
'
{
TDenginePath
}
/sim/dnode1/data/vnode/vnode2/tsdb/data'
]
result
=
subprocess
.
run
(
commandArray
,
stdout
=
subprocess
.
PIPE
).
stdout
.
decode
(
'utf-8'
)
print
(
result
.
count
(
'data'
))
...
...
@@ -61,9 +74,12 @@ class TDTestCase:
tdLog
.
debug
(
"data file number correct"
)
tdSql
.
query
(
'select first(ts) from stb_0'
)
tdSql
.
checkData
(
0
,
0
,
datetime
(
2020
,
10
,
14
,
8
,
0
,
0
,
0
))
#check the last data in the database
os
.
system
(
'sudo timedatectl set-ntp on'
)
tdLog
.
sleep
(
10
)
def
stop
(
self
):
os
.
system
(
'sudo timedatectl set-ntp on'
)
tdLog
.
sleep
(
10
)
tdSql
.
close
()
tdLog
.
success
(
"alter block manual check finish"
)
...
...
tests/pytest/client/change_time_1_2.py
浏览文件 @
923234a0
...
...
@@ -34,34 +34,52 @@ class TDTestCase:
## change system time to 2020/10/20
os
.
system
(
'timedatectl set-ntp off'
)
tdLog
.
sleep
(
10
)
os
.
system
(
'timedatectl set-time 2020-10-20'
)
#run taosdemo to insert data. one row per second from 2020/10/11 to 2020/10/20
#11 data files should be generated
#vnode at TDinternal/community/sim/dnode1/data/vnode
os
.
system
(
f
"
{
binPath
}
taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_A.json"
)
commandArray
=
[
'ls'
,
'-l'
,
f
'
{
TDenginePath
}
/sim/dnode1/data/vnode/vnode2/tsdb/data'
]
result
=
subprocess
.
run
(
commandArray
,
stdout
=
subprocess
.
PIPE
).
stdout
.
decode
(
'utf-8'
)
print
(
result
.
count
(
'data'
))
try
:
os
.
system
(
f
"
{
binPath
}
taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_A.json"
)
commandArray
=
[
'ls'
,
'-l'
,
f
'
{
TDenginePath
}
/sim/dnode1/data/vnode/vnode2/tsdb/data'
]
result
=
subprocess
.
run
(
commandArray
,
stdout
=
subprocess
.
PIPE
).
stdout
.
decode
(
'utf-8'
)
except
BaseException
:
os
.
system
(
'sudo timedatectl set-ntp on'
)
tdLog
.
sleep
(
10
)
if
result
.
count
(
'data'
)
!=
11
:
os
.
system
(
'sudo timedatectl set-ntp on'
)
tdLog
.
sleep
(
10
)
tdLog
.
exit
(
'wrong number of files'
)
else
:
tdLog
.
debug
(
"data file number correct"
)
tdSql
.
query
(
'select first(ts) from stb_0'
)
#check the last data in the database
tdSql
.
checkData
(
0
,
0
,
datetime
(
2020
,
10
,
11
,
0
,
0
,
0
,
0
))
os
.
system
(
'timedatectl set-time 2020-10-25'
)
try
:
tdSql
.
query
(
'select first(ts) from stb_0'
)
#check the last data in the database
tdSql
.
checkData
(
0
,
0
,
datetime
(
2020
,
10
,
11
,
0
,
0
,
0
,
0
))
except
BaseException
:
os
.
system
(
'sudo timedatectl set-ntp on'
)
tdLog
.
sleep
(
10
)
#moves 5 days ahead to 2020/10/25 and restart taosd
#4 oldest data file should be removed from tsdb/data
#7 data file should be found
#vnode at TDinternal/community/sim/dnode1/data/vnode
os
.
system
(
'timedatectl set-time 2020-10-25'
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
query
(
'select first(ts) from stb_0'
)
tdSql
.
checkData
(
0
,
0
,
datetime
(
2020
,
10
,
14
,
8
,
0
,
0
,
0
))
#check the last data in the database
try
:
os
.
system
(
'timedatectl set-time 2020-10-25'
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
query
(
'select first(ts) from stb_0'
)
tdSql
.
checkData
(
0
,
0
,
datetime
(
2020
,
10
,
14
,
8
,
0
,
0
,
0
))
#check the last data in the database
except
BaseException
:
os
.
system
(
'sudo timedatectl set-ntp on'
)
tdLog
.
sleep
(
10
)
os
.
system
(
'sudo timedatectl set-ntp on'
)
tdLog
.
sleep
(
10
)
commandArray
=
[
'ls'
,
'-l'
,
f
'
{
TDenginePath
}
/sim/dnode1/data/vnode/vnode2/tsdb/data'
]
result
=
subprocess
.
run
(
commandArray
,
stdout
=
subprocess
.
PIPE
).
stdout
.
decode
(
'utf-8'
)
print
(
result
.
count
(
'data'
))
...
...
@@ -69,8 +87,8 @@ class TDTestCase:
tdLog
.
exit
(
'wrong number of files'
)
else
:
tdLog
.
debug
(
"data file number correct"
)
os
.
system
(
'sudo timedatectl set-ntp on'
)
tdLog
.
sleep
(
10
)
def
stop
(
self
):
os
.
system
(
'sudo timedatectl set-ntp on'
)
...
...
tests/pytest/fulltest.sh
浏览文件 @
923234a0
...
...
@@ -257,8 +257,8 @@ python3 ./test.py -f client/client.py
python3 ./test.py
-f
client/version.py
python3 ./test.py
-f
client/alterDatabase.py
python3 ./test.py
-f
client/noConnectionErrorTest.py
#python3 test.py -f client/change_time_1_1.py
#python3 test.py -f client/change_time_1_2.py
#
python3 test.py -f client/change_time_1_1.py
#
python3 test.py -f client/change_time_1_2.py
# Misc
python3 testCompress.py
...
...
@@ -342,7 +342,7 @@ python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJson.py
python3 test.py
-f
tools/taosdemoAllTest/taosdemoTestQueryWithJson.py
python3 ./test.py
-f
tag_lite/drop_auto_create.py
python3 test.py
-f
insert/insert_before_use_db.py
#
python3 test.py -f alter/alter_keep.py
python3 test.py
-f
alter/alter_keep.py
python3 test.py
-f
alter/alter_cacheLastRow.py
python3 ./test.py
-f
query/querySession.py
python3 test.py
-f
alter/alter_create_exception.py
...
...
tests/script/api/stmtBatchTest.c
浏览文件 @
923234a0
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录