Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d01ea301
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看板
提交
d01ea301
编写于
6月 02, 2021
作者:
haoranc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-4290]<test>: modify testcase that compact wal file
上级
17077cb9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
9 deletion
+16
-9
tests/pytest/wal/sdbComp.py
tests/pytest/wal/sdbComp.py
+11
-6
tests/pytest/wal/sdbCompCluster.py
tests/pytest/wal/sdbCompCluster.py
+5
-3
未找到文件。
tests/pytest/wal/sdbComp.py
浏览文件 @
d01ea301
...
...
@@ -44,6 +44,8 @@ class TDTestCase:
return
buildPath
def
run
(
self
):
# set path para
buildPath
=
self
.
getBuildPath
()
if
(
buildPath
==
""
):
tdLog
.
exit
(
"taosd not found!"
)
...
...
@@ -52,7 +54,8 @@ class TDTestCase:
binPath
=
buildPath
+
"/build/bin/"
testPath
=
buildPath
[:
buildPath
.
find
(
"debug"
)]
walFilePath
=
testPath
+
"/sim/dnode1/data/mnode_bak/wal/"
#new db and insert data
os
.
system
(
"rm -rf %s/sim/dnode1/data/mnode_tmp/"
%
testPath
)
os
.
system
(
"rm -rf %s/sim/dnode1/data/mnode_bak/"
%
testPath
)
...
...
@@ -77,20 +80,22 @@ class TDTestCase:
tdSql
.
execute
(
"alter table stb2_0 add column col2 binary(4)"
)
tdSql
.
execute
(
"alter table stb2_0 drop column col1"
)
tdSql
.
execute
(
"insert into stb2_0 values(1614218422000,8638,'R')"
)
# stop taosd and compact wal file
tdDnodes
.
stop
(
1
)
sleep
(
10
)
os
.
system
(
"nohup %s/taosd --compact-mnode-wal -c %s/sim/dnode1/cfg/ & "
%
(
binPath
,
testPath
)
)
# os.system("nohup taosd --compact-mnode-wal -c %s/sim/dnode1/cfg/ & " % testPath )
sleep
(
5
)
# tdDnodes.start(1)
os
.
system
(
"nohup %s/taosd -c %s/sim/dnode1/cfg > /dev/null 2>&1 &"
%
(
binPath
,
testPath
)
)
sleep
(
4
)
assert
os
.
path
.
exists
(
walFilePath
)
,
"%s is not generated, compact didn't take effect "
%
walFilePath
# use new wal file to start taosd
tdDnodes
.
start
(
1
)
sleep
(
5
)
tdSql
.
execute
(
"reset query cache"
)
query_pid2
=
int
(
subprocess
.
getstatusoutput
(
'ps aux|grep taosd |grep -v "grep"|awk
\'
{print $2}
\'
'
)[
1
])
print
(
query_pid2
)
#
use new wal file to start up tasod
#
verify that the data is correct
tdSql
.
execute
(
"use db2"
)
tdSql
.
query
(
"select count (tbname) from stb0"
)
tdSql
.
checkData
(
0
,
0
,
1
)
...
...
tests/pytest/wal/sdbCompCluster.py
浏览文件 @
d01ea301
...
...
@@ -54,8 +54,9 @@ class TwoClients:
else
:
tdLog
.
info
(
"taosd found in %s"
%
buildPath
)
binPath
=
buildPath
+
"/build/bin/"
# query data from cluster'db
walFilePath
=
"/var/lib/taos/mnode_bak/wal/"
# new taos client
conn1
=
taos
.
connect
(
host
=
self
.
host
,
user
=
self
.
user
,
password
=
self
.
password
,
config
=
self
.
config
)
print
(
conn1
)
cur1
=
conn1
.
cursor
()
...
...
@@ -95,13 +96,14 @@ class TwoClients:
# stop taosd and compact wal file
os
.
system
(
"ps -ef |grep taosd |grep -v 'grep' |awk '{print $2}'|xargs kill -9"
)
sleep
(
2
)
os
.
system
(
"nohup taosd --compact-mnode-wal -c /etc/taos
/taos.cfg
& "
)
os
.
system
(
"nohup taosd --compact-mnode-wal -c /etc/taos & "
)
sleep
(
5
)
os
.
system
(
"nohup /usr/bin/taosd > /dev/null 2>&1 &"
)
sleep
(
4
)
tdSql
.
execute
(
"reset query cache"
)
query_pid2
=
int
(
subprocess
.
getstatusoutput
(
'ps aux|grep taosd |grep -v "grep"|awk
\'
{print $2}
\'
'
)[
1
])
print
(
query_pid2
)
assert
os
.
path
.
exists
(
walFilePath
)
,
"%s is not generated "
%
walFilePath
# use new wal file to start up tasod
tdSql
.
execute
(
"use db2"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录