Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d4890ee2
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d4890ee2
编写于
6月 27, 2022
作者:
haoranc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test:modify testcase of muti-monde
上级
ec8a1e54
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
177 deletion
+0
-177
tests/system-test/6-cluster/5dnode3mnodeStop.py
tests/system-test/6-cluster/5dnode3mnodeStop.py
+0
-177
未找到文件。
tests/system-test/6-cluster/5dnode3mnodeStop.py
浏览文件 @
d4890ee2
...
...
@@ -45,179 +45,6 @@ class TDTestCase:
buildPath
=
root
[:
len
(
root
)
-
len
(
"/build/bin"
)]
break
return
buildPath
def
insert_data
(
self
,
count
):
# fisrt add data : db\stable\childtable\general table
for
couti
in
count
:
tdSql
.
execute
(
"drop database if exists db%d"
%
couti
)
tdSql
.
execute
(
"create database if not exists db%d replica 1 duration 300"
%
couti
)
tdSql
.
execute
(
"use db%d"
%
couti
)
tdSql
.
execute
(
'''create table stb1
(ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp)
tags (t1 int)
'''
)
tdSql
.
execute
(
'''
create table t1
(ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp)
'''
)
for
i
in
range
(
4
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags (
{
i
+
1
}
)'
)
def
check3mnode
(
self
):
count
=
0
while
count
<
10
:
time
.
sleep
(
1
)
tdSql
.
query
(
"show mnodes;"
)
if
tdSql
.
checkRows
(
3
)
:
tdLog
.
debug
(
"mnode is three nodes"
)
else
:
tdLog
.
exit
(
"mnode number is correct"
)
if
tdSql
.
queryResult
[
0
][
2
]
==
'leader'
:
if
tdSql
.
queryResult
[
1
][
2
]
==
'follower'
:
if
tdSql
.
queryResult
[
2
][
2
]
==
'follower'
:
tdLog
.
debug
(
"three mnodes is ready in 10s"
)
break
elif
tdSql
.
queryResult
[
1
][
2
]
==
'leader'
:
if
tdSql
.
queryResult
[
0
][
2
]
==
'follower'
:
if
tdSql
.
queryResult
[
2
][
2
]
==
'follower'
:
tdLog
.
debug
(
"three mnodes is ready in 10s"
)
break
elif
tdSql
.
queryResult
[
2
][
2
]
==
'leader'
:
if
tdSql
.
queryResult
[
1
][
2
]
==
'follower'
:
if
tdSql
.
queryResult
[
0
][
2
]
==
'follower'
:
tdLog
.
debug
(
"three mnodes is ready in 10s"
)
break
count
+=
1
else
:
tdLog
.
exit
(
"three mnodes is not ready in 10s "
)
tdSql
.
query
(
"show mnodes;"
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkData
(
0
,
1
,
'%s:6030'
%
self
.
host
)
tdSql
.
checkData
(
0
,
3
,
'ready'
)
tdSql
.
checkData
(
1
,
1
,
'%s:6130'
%
self
.
host
)
tdSql
.
checkData
(
1
,
3
,
'ready'
)
tdSql
.
checkData
(
2
,
1
,
'%s:6230'
%
self
.
host
)
tdSql
.
checkData
(
2
,
3
,
'ready'
)
def
check3mnode1off
(
self
):
count
=
0
while
count
<
10
:
time
.
sleep
(
1
)
tdSql
.
query
(
"show mnodes;"
)
if
tdSql
.
checkRows
(
3
)
:
tdLog
.
debug
(
"mnode is three nodes"
)
else
:
tdLog
.
exit
(
"mnode number is correct"
)
if
tdSql
.
queryResult
[
0
][
2
]
==
'offline'
:
if
tdSql
.
queryResult
[
1
][
2
]
==
'leader'
:
if
tdSql
.
queryResult
[
2
][
2
]
==
'follower'
:
tdLog
.
debug
(
"stop mnodes on dnode 2 successfully in 10s"
)
break
elif
tdSql
.
queryResult
[
1
][
2
]
==
'follower'
:
if
tdSql
.
queryResult
[
2
][
2
]
==
'leader'
:
tdLog
.
debug
(
"stop mnodes on dnode 2 successfully in 10s"
)
break
count
+=
1
else
:
tdLog
.
exit
(
"stop mnodes on dnode 2 failed in 10s "
)
tdSql
.
error
(
"drop mnode on dnode 1;"
)
tdSql
.
query
(
"show mnodes;"
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkData
(
0
,
1
,
'%s:6030'
%
self
.
host
)
tdSql
.
checkData
(
0
,
2
,
'offline'
)
tdSql
.
checkData
(
0
,
3
,
'ready'
)
tdSql
.
checkData
(
1
,
1
,
'%s:6130'
%
self
.
host
)
tdSql
.
checkData
(
1
,
3
,
'ready'
)
tdSql
.
checkData
(
2
,
1
,
'%s:6230'
%
self
.
host
)
tdSql
.
checkData
(
2
,
3
,
'ready'
)
def
check3mnode2off
(
self
):
count
=
0
while
count
<
40
:
time
.
sleep
(
1
)
tdSql
.
query
(
"show mnodes;"
)
if
tdSql
.
checkRows
(
3
)
:
tdLog
.
debug
(
"mnode is three nodes"
)
else
:
tdLog
.
exit
(
"mnode number is correct"
)
if
tdSql
.
queryResult
[
0
][
2
]
==
'leader'
:
if
tdSql
.
queryResult
[
1
][
2
]
==
'offline'
:
if
tdSql
.
queryResult
[
2
][
2
]
==
'follower'
:
tdLog
.
debug
(
"stop mnodes on dnode 2 successfully in 10s"
)
break
count
+=
1
else
:
tdLog
.
exit
(
"stop mnodes on dnode 2 failed in 10s "
)
tdSql
.
error
(
"drop mnode on dnode 2;"
)
tdSql
.
query
(
"show mnodes;"
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkData
(
0
,
1
,
'%s:6030'
%
self
.
host
)
tdSql
.
checkData
(
0
,
3
,
'ready'
)
tdSql
.
checkData
(
1
,
1
,
'%s:6130'
%
self
.
host
)
tdSql
.
checkData
(
1
,
3
,
'ready'
)
tdSql
.
checkData
(
2
,
1
,
'%s:6230'
%
self
.
host
)
tdSql
.
checkData
(
2
,
3
,
'ready'
)
def
check3mnode3off
(
self
):
count
=
0
while
count
<
10
:
time
.
sleep
(
1
)
tdSql
.
query
(
"show mnodes;"
)
if
tdSql
.
checkRows
(
3
)
:
tdLog
.
debug
(
"mnode is three nodes"
)
else
:
tdLog
.
exit
(
"mnode number is correct"
)
if
tdSql
.
queryResult
[
0
][
2
]
==
'leader'
:
if
tdSql
.
queryResult
[
2
][
2
]
==
'offline'
:
if
tdSql
.
queryResult
[
1
][
2
]
==
'follower'
:
tdLog
.
debug
(
"stop mnodes on dnode 3 successfully in 10s"
)
break
count
+=
1
else
:
tdLog
.
exit
(
"stop mnodes on dnode 3 failed in 10s"
)
tdSql
.
error
(
"drop mnode on dnode 3;"
)
tdSql
.
query
(
"show mnodes;"
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkData
(
0
,
1
,
'%s:6030'
%
self
.
host
)
tdSql
.
checkData
(
0
,
2
,
'leader'
)
tdSql
.
checkData
(
0
,
3
,
'ready'
)
tdSql
.
checkData
(
1
,
1
,
'%s:6130'
%
self
.
host
)
tdSql
.
checkData
(
1
,
2
,
'follower'
)
tdSql
.
checkData
(
1
,
3
,
'ready'
)
tdSql
.
checkData
(
2
,
1
,
'%s:6230'
%
self
.
host
)
tdSql
.
checkData
(
2
,
2
,
'offline'
)
tdSql
.
checkData
(
2
,
3
,
'ready'
)
def
check_dnodes_status
(
self
,
dnodeNumbers
):
count
=
0
while
count
<
5
:
tdSql
.
query
(
"show dnodes"
)
# tdLog.debug(tdSql.queryResult)
status
=
0
for
i
in
range
(
dnodeNumbers
):
if
tdSql
.
queryResult
[
i
][
4
]
==
"ready"
:
status
+=
1
tdLog
.
debug
(
status
)
if
status
==
dnodeNumbers
:
tdLog
.
debug
(
" create cluster with %d dnode and check cluster dnode all ready within 5s! "
%
dnodeNumbers
)
break
count
+=
1
time
.
sleep
(
1
)
else
:
tdLog
.
exit
(
"create cluster with %d dnode but check dnode not ready within 5s ! "
%
dnodeNumbers
)
def
fiveDnodeThreeMnode
(
self
,
dnodenumbers
,
mnodeNums
,
restartNumber
):
tdLog
.
printNoPrefix
(
"======== test case 1: "
)
...
...
@@ -253,11 +80,7 @@ class TDTestCase:
# fisr add three mnodes;
tdLog
.
info
(
"fisr add three mnodes and check mnode status"
)
tdSql
.
execute
(
"create mnode on dnode 2"
)
<<<<<<<
HEAD
clusterComCheck
.
checkMnodeStatus
(
2
)
=======
time
.
sleep
(
10
)
>>>>>>>
e571567ec2ae0c7668ccf1b8aaaf949fc84bb44c
tdSql
.
execute
(
"create mnode on dnode 3"
)
clusterComCheck
.
checkMnodeStatus
(
3
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录