Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
66f31a00
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1191
Star
22018
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看板
未验证
提交
66f31a00
编写于
3月 26, 2022
作者:
sangshuduo
提交者:
GitHub
3月 26, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-14331]<fix>: make util/dnodes.py flexible (#11022)
* [TD-14331]<fix>: make util/dnodes.py flexible for 3.0 * make getPath clear
上级
7095e7c6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
60 addition
and
59 deletion
+60
-59
tests/pytest/util/dnodes.py
tests/pytest/util/dnodes.py
+60
-59
未找到文件。
tests/pytest/util/dnodes.py
浏览文件 @
66f31a00
...
...
@@ -71,7 +71,7 @@ class TDSimClient:
cmd
=
"rm -rf "
+
self
.
logDir
if
os
.
system
(
cmd
)
!=
0
:
tdLog
.
exit
(
cmd
)
cmd
=
"mkdir -p "
+
self
.
logDir
if
os
.
system
(
cmd
)
!=
0
:
tdLog
.
exit
(
cmd
)
...
...
@@ -107,36 +107,36 @@ class TDDnode:
self
.
testCluster
=
False
self
.
valgrind
=
0
self
.
cfgDict
=
{
"numOfLogLines"
:
"100000000"
,
"mnodeEqualVnodeNum"
:
"0"
,
"walLevel"
:
"2"
,
"fsync"
:
"1000"
,
"statusInterval"
:
"1"
,
"numOfMnodes"
:
"3"
,
"numOfThreadsPerCore"
:
"2.0"
,
"monitor"
:
"0"
,
"maxVnodeConnections"
:
"30000"
,
"maxMgmtConnections"
:
"30000"
,
"maxMeterConnections"
:
"30000"
,
"maxShellConns"
:
"30000"
,
"locale"
:
"en_US.UTF-8"
,
"charset"
:
"UTF-8"
,
"asyncLog"
:
"0"
,
"anyIp"
:
"0"
,
"telemetryReporting"
:
"0"
,
"dDebugFlag"
:
"135"
,
"tsdbDebugFlag"
:
"135"
,
"mDebugFlag"
:
"135"
,
"sdbDebugFlag"
:
"135"
,
"rpcDebugFlag"
:
"135"
,
"tmrDebugFlag"
:
"131"
,
"cDebugFlag"
:
"135"
,
"httpDebugFlag"
:
"135"
,
"monitorDebugFlag"
:
"135"
,
"udebugFlag"
:
"135"
,
"jnidebugFlag"
:
"135"
,
"qdebugFlag"
:
"135"
,
"maxSQLLength"
:
"1048576"
"numOfLogLines"
:
"100000000"
,
"mnodeEqualVnodeNum"
:
"0"
,
"walLevel"
:
"2"
,
"fsync"
:
"1000"
,
"statusInterval"
:
"1"
,
"numOfMnodes"
:
"3"
,
"numOfThreadsPerCore"
:
"2.0"
,
"monitor"
:
"0"
,
"maxVnodeConnections"
:
"30000"
,
"maxMgmtConnections"
:
"30000"
,
"maxMeterConnections"
:
"30000"
,
"maxShellConns"
:
"30000"
,
"locale"
:
"en_US.UTF-8"
,
"charset"
:
"UTF-8"
,
"asyncLog"
:
"0"
,
"anyIp"
:
"0"
,
"telemetryReporting"
:
"0"
,
"dDebugFlag"
:
"135"
,
"tsdbDebugFlag"
:
"135"
,
"mDebugFlag"
:
"135"
,
"sdbDebugFlag"
:
"135"
,
"rpcDebugFlag"
:
"135"
,
"tmrDebugFlag"
:
"131"
,
"cDebugFlag"
:
"135"
,
"httpDebugFlag"
:
"135"
,
"monitorDebugFlag"
:
"135"
,
"udebugFlag"
:
"135"
,
"jnidebugFlag"
:
"135"
,
"qdebugFlag"
:
"135"
,
"maxSQLLength"
:
"1048576"
}
def
init
(
self
,
path
):
...
...
@@ -216,16 +216,16 @@ class TDDnode:
isFirstDir
=
1
if
updatecfgDict
[
0
]
and
updatecfgDict
[
0
][
0
]:
print
(
updatecfgDict
[
0
][
0
])
for
key
,
value
in
updatecfgDict
[
0
][
0
].
items
():
if
value
==
'dataDir'
:
for
key
,
value
in
updatecfgDict
[
0
][
0
].
items
():
if
value
==
'dataDir'
:
if
isFirstDir
:
self
.
cfgDict
.
pop
(
'dataDir'
)
self
.
cfg
(
value
,
key
)
self
.
cfg
(
value
,
key
)
isFirstDir
=
0
else
:
self
.
cfg
(
value
,
key
)
self
.
cfg
(
value
,
key
)
else
:
self
.
addExtraCfg
(
key
,
value
)
self
.
addExtraCfg
(
key
,
value
)
for
key
,
value
in
self
.
cfgDict
.
items
():
self
.
cfg
(
key
,
value
)
...
...
@@ -234,8 +234,7 @@ class TDDnode:
"dnode:%d is deployed and configured by %s"
%
(
self
.
index
,
self
.
cfgPath
))
def
getBuildPath
(
self
):
buildPath
=
""
def
getPath
(
self
,
tool
=
"taosd"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
...
...
@@ -243,23 +242,22 @@ class TDDnode:
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
((
"taosd"
)
in
files
):
if
((
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
buildPath
=
root
[:
len
(
root
)
-
len
(
"/build/bin"
)]
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
return
buildPath
return
paths
[
0
]
def
start
(
self
):
b
uildPath
=
self
.
getBuild
Path
()
b
inPath
=
self
.
get
Path
()
if
(
b
uild
Path
==
""
):
if
(
b
in
Path
==
""
):
tdLog
.
exit
(
"taosd not found!"
)
else
:
tdLog
.
info
(
"taosd found in %s"
%
buildPath
)
binPath
=
buildPath
+
"/build/bin/taosd"
tdLog
.
info
(
"taosd found: %s"
%
binPath
)
if
self
.
deployed
==
0
:
tdLog
.
exit
(
"dnode:%d is not deployed"
%
(
self
.
index
))
...
...
@@ -282,18 +280,22 @@ class TDDnode:
if
self
.
valgrind
==
0
:
time
.
sleep
(
0.1
)
key
=
'from offline to online'
bkey
=
bytes
(
key
,
encoding
=
"utf8"
)
bkey
=
bytes
(
key
,
encoding
=
"utf8"
)
logFile
=
self
.
logDir
+
"/taosdlog.0"
i
=
0
while
not
os
.
path
.
exists
(
logFile
):
sleep
(
0.1
)
i
+=
1
if
i
>
50
:
if
i
>
50
:
break
popen
=
subprocess
.
Popen
(
'tail -f '
+
logFile
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
shell
=
True
)
popen
=
subprocess
.
Popen
(
'tail -f '
+
logFile
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
shell
=
True
)
pid
=
popen
.
pid
# print('Popen.pid:' + str(pid))
timeout
=
time
.
time
()
+
60
*
2
timeout
=
time
.
time
()
+
60
*
2
while
True
:
line
=
popen
.
stdout
.
readline
().
strip
()
if
bkey
in
line
:
...
...
@@ -303,21 +305,20 @@ class TDDnode:
tdLog
.
exit
(
'wait too long for taosd start'
)
tdLog
.
debug
(
"the dnode:%d has been started."
%
(
self
.
index
))
else
:
tdLog
.
debug
(
"wait 10 seconds for the dnode:%d to start."
%
(
self
.
index
))
tdLog
.
debug
(
"wait 10 seconds for the dnode:%d to start."
%
(
self
.
index
))
time
.
sleep
(
10
)
# time.sleep(5)
def
startWithoutSleep
(
self
):
b
uildPath
=
self
.
getBuild
Path
()
b
inPath
=
self
.
get
Path
()
if
(
b
uild
Path
==
""
):
if
(
b
in
Path
==
""
):
tdLog
.
exit
(
"taosd not found!"
)
else
:
tdLog
.
info
(
"taosd found in %s"
%
buildPath
)
binPath
=
buildPath
+
"/build/bin/taosd"
tdLog
.
info
(
"taosd found: %s"
%
binPath
)
if
self
.
deployed
==
0
:
tdLog
.
exit
(
"dnode:%d is not deployed"
%
(
self
.
index
))
...
...
@@ -505,7 +506,7 @@ class TDDnodes:
def
start
(
self
,
index
):
self
.
check
(
index
)
self
.
dnodes
[
index
-
1
].
start
()
def
startWithoutSleep
(
self
,
index
):
self
.
check
(
index
)
self
.
dnodes
[
index
-
1
].
startWithoutSleep
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录