Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
acc2ea69
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看板
未验证
提交
acc2ea69
编写于
7月 18, 2022
作者:
H
Hui Li
提交者:
GitHub
7月 18, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15054 from taosdata/test/update_cachelast
test:update cachemodel test case ,and let it takes effect in storage
上级
51ea4941
b8396869
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
52 addition
and
40 deletion
+52
-40
tests/system-test/0-others/cachemodel.py
tests/system-test/0-others/cachemodel.py
+51
-39
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+1
-1
未找到文件。
tests/system-test/0-others/cache
last
.py
→
tests/system-test/0-others/cache
model
.py
浏览文件 @
acc2ea69
...
...
@@ -56,6 +56,16 @@ class TDTestCase:
}
return
numbers
.
get
(
value
,
'other'
)
def
getCacheModelNum
(
self
,
str
):
numbers
=
{
"none"
:
0
,
"last_row"
:
1
,
"last_value"
:
2
,
"both"
:
3
}
return
numbers
.
get
(
str
,
'other'
)
def
prepare_datas
(
self
):
for
i
in
range
(
4
):
str
=
self
.
getCacheModelStr
(
i
)
...
...
@@ -69,7 +79,7 @@ class TDTestCase:
tdSql
.
execute
(
" insert into tb1 values(now , %d, %f)"
%
(
k
,
k
*
10
)
)
tdSql
.
execute
(
" insert into tb2 values(now , %d, %f)"
%
(
k
,
k
*
10
)
)
def
check_cache
_last
_sets
(
self
):
def
check_cache
model
_sets
(
self
):
# check cache_last value for database
...
...
@@ -84,52 +94,54 @@ class TDTestCase:
# print(cache_last_value)
if
dbname
in
[
"information_schema"
,
"performance_schema"
]:
continue
cache_lasts
[
dbname
]
=
cache_last_value
cache_lasts
[
dbname
]
=
self
.
getCacheModelNum
(
cache_last_value
)
# cache_last_set value
for
k
,
v
in
cache_lasts
.
items
():
if
k
==
"testdb_"
+
str
(
v
):
tdLog
.
info
(
" database %s cache_last value check pass, value is %s "
%
(
k
,
v
)
)
if
k
==
"testdb_"
+
str
(
self
.
getCacheModelStr
(
v
)
):
tdLog
.
info
(
" database %s cache_last value check pass, value is %s "
%
(
k
,
self
.
getCacheModelStr
(
v
)
)
)
else
:
tdLog
.
exit
(
" database %s cache_last value check fail, value is %s "
%
(
k
,
v
)
)
tdLog
.
exit
(
" database %s cache_last value check fail, value is %s "
%
(
k
,
self
.
getCacheModelStr
(
v
)
)
)
# # check storage layer implementation
#
buildPath = self.getBuildPath()
#
if (buildPath == ""):
#
tdLog.exit("taosd not found!")
#
else:
#
tdLog.info("taosd found in %s" % buildPath)
#
dataPath = buildPath + "/../sim/dnode1/data"
#
abs_vnodePath = os.path.abspath(dataPath)+"/vnode/"
#
tdLog.info("abs_vnodePath: %s" % abs_vnodePath)
buildPath
=
self
.
getBuildPath
()
if
(
buildPath
==
""
):
tdLog
.
exit
(
"taosd not found!"
)
else
:
tdLog
.
info
(
"taosd found in %s"
%
buildPath
)
dataPath
=
buildPath
+
"/../sim/dnode1/data"
abs_vnodePath
=
os
.
path
.
abspath
(
dataPath
)
+
"/vnode/"
tdLog
.
info
(
"abs_vnodePath: %s"
%
abs_vnodePath
)
# tdSql.query(" show dnodes ")
# dnode_id = tdSql.queryResult[0][0]
# for dbname in cache_lasts.keys():
# print(dbname)
# tdSql.execute(" use %s" % dbname)
# tdSql.query(" show vgroups ")
# vgroups_infos = tdSql.queryResult
# for vgroup_info in vgroups_infos:
# vnode_json = abs_vnodePath + "/vnode" +f"{vgroup_info[0]}/" + "vnode.json"
# vnode_info_of_db = f"cat {vnode_json}"
# vnode_info = subprocess.check_output(vnode_info_of_db, shell=True).decode("utf-8")
# infoDict = json.loads(vnode_info)
# vnode_json_of_dbname = f"{dnode_id}."+ dbname
# config = infoDict["config"]
# if infoDict["config"]["dbname"] == vnode_json_of_dbname:
# if "cachelast" in infoDict["config"]:
# if int(infoDict["config"]["cachelast"]) != cache_lasts[dbname]:
# tdLog.exit("cachelast value is error in vnode.json of vnode%d "%(vgroup_info[0]))
# else:
# tdLog.exit("cachelast not found in vnode.json of vnode%d "%(vgroup_info[0]))
def
restart_check_cache_last_sets
(
self
):
tdSql
.
query
(
" show dnodes "
)
dnode_id
=
tdSql
.
queryResult
[
0
][
0
]
for
dbname
in
cache_lasts
.
keys
():
# print(dbname)
tdSql
.
execute
(
" use %s"
%
dbname
)
tdSql
.
query
(
" show vgroups "
)
vgroups_infos
=
tdSql
.
queryResult
for
vgroup_info
in
vgroups_infos
:
vnode_json
=
abs_vnodePath
+
"/vnode"
+
f
"
{
vgroup_info
[
0
]
}
/"
+
"vnode.json"
vnode_info_of_db
=
f
"cat
{
vnode_json
}
"
vnode_info
=
subprocess
.
check_output
(
vnode_info_of_db
,
shell
=
True
).
decode
(
"utf-8"
)
infoDict
=
json
.
loads
(
vnode_info
)
vnode_json_of_dbname
=
f
"
{
dnode_id
}
."
+
dbname
config
=
infoDict
[
"config"
]
if
infoDict
[
"config"
][
"dbname"
]
==
vnode_json_of_dbname
:
if
"cacheLast"
in
infoDict
[
"config"
]:
if
int
(
infoDict
[
"config"
][
"cacheLast"
])
!=
cache_lasts
[
dbname
]:
tdLog
.
exit
(
"cachemodel value is error in vnode.json of vnode%d "
%
(
vgroup_info
[
0
]))
else
:
tdLog
.
info
(
"cachemodel value is success in vnode.json of vnode%d "
%
(
vgroup_info
[
0
]))
else
:
tdLog
.
exit
(
"cacheLast not found in vnode.json of vnode%d "
%
(
vgroup_info
[
0
]))
def
restart_check_cachemodel_sets
(
self
):
for
i
in
range
(
3
):
tdSql
.
query
(
"show dnodes"
)
...
...
@@ -137,14 +149,14 @@ class TDTestCase:
tdDnodes
.
stop
(
index
)
tdDnodes
.
start
(
index
)
time
.
sleep
(
3
)
self
.
check_cache
_last
_sets
()
self
.
check_cache
model
_sets
()
def
run
(
self
):
# sourcery skip: extract-duplicate-method, remove-redundant-fstring
self
.
illegal_params
()
self
.
prepare_datas
()
self
.
check_cache
_last
_sets
()
self
.
restart_check_cache
_last
_sets
()
self
.
check_cache
model
_sets
()
self
.
restart_check_cache
model
_sets
()
def
stop
(
self
):
tdSql
.
close
()
...
...
tests/system-test/fulltest.sh
浏览文件 @
acc2ea69
...
...
@@ -10,7 +10,7 @@ python3 ./test.py -f 0-others/taosdMonitor.py
python3 ./test.py
-f
0-others/udfTest.py
python3 ./test.py
-f
0-others/udf_create.py
python3 ./test.py
-f
0-others/udf_restart_taosd.py
python3 ./test.py
-f
0-others/cache
last
.py
python3 ./test.py
-f
0-others/cache
model
.py
python3 ./test.py
-f
0-others/udf_cfg1.py
python3 ./test.py
-f
0-others/udf_cfg2.py
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录