Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9bccfe95
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看板
未验证
提交
9bccfe95
编写于
3月 29, 2021
作者:
H
huili
提交者:
GitHub
3月 29, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5599 from taosdata/test/jenkins
[TD-3570]<test>add taosd valgrind test
上级
7abd3da2
b03c0c20
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
87 addition
and
0 deletion
+87
-0
Jenkinsfile
Jenkinsfile
+8
-0
tests/Jenkinsfile
tests/Jenkinsfile
+11
-0
tests/pytest/handle_taosd_val_log.sh
tests/pytest/handle_taosd_val_log.sh
+68
-0
未找到文件。
Jenkinsfile
浏览文件 @
9bccfe95
...
@@ -185,6 +185,14 @@ pipeline {
...
@@ -185,6 +185,14 @@ pipeline {
rm -rf /var/log/taos/*
rm -rf /var/log/taos/*
./handle_crash_gen_val_log.sh
./handle_crash_gen_val_log.sh
'''
'''
catchError
(
buildResult:
'SUCCESS'
,
stageResult:
'FAILURE'
)
{
sh
'''
cd ${WKC}/tests/pytest
rm -rf /var/lib/taos/*
rm -rf /var/log/taos/*
./handle_taosd_val_log.sh
'''
}
timeout
(
time:
45
,
unit:
'MINUTES'
){
timeout
(
time:
45
,
unit:
'MINUTES'
){
sh
'''
sh
'''
date
date
...
...
tests/Jenkinsfile
浏览文件 @
9bccfe95
...
@@ -76,9 +76,20 @@ pipeline {
...
@@ -76,9 +76,20 @@ pipeline {
catchError
(
buildResult:
'SUCCESS'
,
stageResult:
'FAILURE'
)
{
catchError
(
buildResult:
'SUCCESS'
,
stageResult:
'FAILURE'
)
{
sh
'''
sh
'''
cd ${WKC}/tests/pytest
cd ${WKC}/tests/pytest
rm -rf /var/lib/taos/*
rm -rf /var/log/taos/*
./handle_crash_gen_val_log.sh
./handle_crash_gen_val_log.sh
'''
'''
}
}
catchError
(
buildResult:
'SUCCESS'
,
stageResult:
'FAILURE'
)
{
sh
'''
cd ${WKC}/tests/pytest
rm -rf /var/lib/taos/*
rm -rf /var/log/taos/*
./handle_taosd_val_log.sh
'''
}
sh
'''
sh
'''
systemctl start taosd
systemctl start taosd
sleep 10
sleep 10
...
...
tests/pytest/handle_taosd_val_log.sh
0 → 100755
浏览文件 @
9bccfe95
#!/bin/bash
# Color setting
RED
=
'\033[0;31m'
GREEN
=
'\033[1;32m'
GREEN_DARK
=
'\033[0;32m'
GREEN_UNDERLINE
=
'\033[4;32m'
NC
=
'\033[0m'
IN_TDINTERNAL
=
"community"
TDIR
=
`
pwd
`
if
[[
"
$tests_dir
"
==
*
"
$IN_TDINTERNAL
"
*
]]
;
then
cd
../..
else
cd
../../..
fi
TOP_DIR
=
`
pwd
`
TAOSD_DIR
=
`
find
.
-name
"taosd"
|grep
-v
community|grep debug|head
-n1
`
VALGRIND_OUT
=
taosd_valgrind.out
VALGRIND_ERR
=
taosd_valgrind.err
rm
-rf
/var/lib/taos/
*
# nohup valgrind --tool=memcheck --leak-check=yes $TAOSD_DIR > $TDIR/$VALGRIND_OUT 2> $TDIR/$VALGRIND_ERR &
nohup
valgrind
--leak-check
=
yes
$TAOSD_DIR
>
$TDIR
/
$VALGRIND_OUT
2>
$TDIR
/
$VALGRIND_ERR
&
sleep
20
cd
-
./crash_gen.sh
-p
-t
10
-s
200
ps
-ef
|grep valgrind|grep
-v
grep
|awk
'{print $2}'
|xargs
kill
-term
while
true
do
monitoring
=
`
ps
-ef
|grep valgrind |grep
-v
grep
|
wc
-l
`
if
[
$monitoring
-eq
0
]
then
echo
"Manipulator is not running "
break
else
sleep
1
fi
done
grep
'start to execute\|ERROR SUMMARY'
$VALGRIND_ERR
|
grep
-v
'grep'
|
uniq
|
tee
taosd_mem_err.log
for
memError
in
`
grep
'ERROR SUMMARY'
taosd_mem_err.log |
awk
'{print $4}'
`
do
memError
=(
${
memError
//,/
}
)
if
[
-n
"
$memError
"
]
;
then
if
[
"
$memError
"
-gt
12
]
;
then
echo
-e
"
${
RED
}
## Memory errors number valgrind reports is
$memError
.
\
More than our threshold! ##
${
NC
}
"
fi
fi
done
grep
'start to execute\|definitely lost:'
$VALGRIND_ERR
|grep
-v
'grep'
|uniq|tee taosd-definitely-lost-out.log
for
defiMemError
in
`
grep
'definitely lost:'
taosd-definitely-lost-out.log |
awk
'{print $7}'
`
do
defiMemError
=(
${
defiMemError
//,/
}
)
if
[
-n
"
$defiMemError
"
]
;
then
if
[
"
$defiMemError
"
-gt
0
-a
"
$defiMemError
"
-lt
1013
]
;
then
cat
$VALGRIND_ERR
echo
-e
"
${
RED
}
## Memory errors number valgrind reports
\
Definitely lost is
$defiMemError
. More than our threshold! ##
${
NC
}
"
exit
8
elif
[
"
$defiMemError
"
-gt
1013
]
;
then
#add for azure
cat
$VALGRIND_ERR
echo
-e
"
${
RED
}
## Memory errors number valgrind reports
\
Definitely lost is
$defiMemError
. More than our threshold! ##
${
NC
}
"
exit
8
fi
fi
done
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录