Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ca102bdc
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ca102bdc
编写于
7月 23, 2022
作者:
wafwerar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: fix mnode leader follower order error
上级
4bf6eac5
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
56 addition
and
28 deletion
+56
-28
tests/script/tsim/mnode/basic4.sim
tests/script/tsim/mnode/basic4.sim
+28
-12
tests/script/tsim/mnode/basic5.sim
tests/script/tsim/mnode/basic5.sim
+11
-7
tests/script/tsim/parser/gendata.bat
tests/script/tsim/parser/gendata.bat
+4
-0
tests/script/tsim/parser/import_file.sim
tests/script/tsim/parser/import_file.sim
+11
-8
tests/system-test/test-all.bat
tests/system-test/test-all.bat
+1
-0
tests/system-test/test.py
tests/system-test/test.py
+1
-1
未找到文件。
tests/script/tsim/mnode/basic4.sim
浏览文件 @
ca102bdc
...
...
@@ -63,10 +63,14 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4]
print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4]
if $data(1)[2] != leader then
goto step3
$leaderNum = 0
if $data(1)[2] == leader then
$leaderNum = 1
endi
if $data(2)[2] == leader then
$leaderNum = 1
endi
if
$data(2)[2] != follower
then
if
$leaderNum == 0
then
goto step3
endi
if $data(3)[2] != offline then
...
...
@@ -97,10 +101,14 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4]
print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4]
if $data(1)[2] != leader then
goto step4
$leaderNum = 0
if $data(1)[2] == leader then
$leaderNum = 1
endi
if $data(2)[2] == leader then
$leaderNum = 1
endi
if
$data(2)[2] != follower
then
if
$leaderNum == 0
then
goto step4
endi
if $data(3)[2] != follower then
...
...
@@ -132,10 +140,14 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4]
print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4]
if $data(1)[2] != leader then
goto step5
$leaderNum = 0
if $data(1)[2] == leader then
$leaderNum = 1
endi
if $data(2)[2] == leader then
$leaderNum = 1
endi
if
$data(2)[2] != follower
then
if
$leaderNum == 0
then
goto step5
endi
if $data(3)[2] != offline then
...
...
@@ -169,10 +181,14 @@ print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4]
if $rows != 2 then
goto step6
endi
if $data(1)[2] != leader then
goto step6
$leaderNum = 0
if $data(1)[2] == leader then
$leaderNum = 1
endi
if $data(2)[2] == leader then
$leaderNum = 1
endi
if
$data(2)[2] != follower
then
if
$leaderNum == 0
then
goto step6
endi
if $data(3)[2] != null then
...
...
tests/script/tsim/mnode/basic5.sim
浏览文件 @
ca102bdc
...
...
@@ -68,13 +68,17 @@ step31:
return -1
endi
sql show mnodes
if $data(1)[2] != leader then
goto step31
$leaderNum = 0
if $data(1)[2] == leader then
$leaderNum = 1
endi
if $data(2)[2]
!= follow
er then
goto step3
1
if $data(2)[2]
== lead
er then
$leaderNum =
1
endi
if $data(3)[2] != follower then
if $data(3)[2] == leader then
$leaderNum = 1
endi
if $leaderNum == 0 then
goto step31
endi
...
...
@@ -302,10 +306,10 @@ print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data20 $data21 $data22 $data23 $data24 $data25
$leaderNum = 0
if $data(
2
)[2] == leader then
if $data(
1
)[2] == leader then
$leaderNum = 1
endi
if $data(
3
)[2] == leader then
if $data(
2
)[2] == leader then
$leaderNum = 1
endi
if $data(3)[2] == leader then
...
...
tests/script/tsim/parser/gendata.bat
0 → 100644
浏览文件 @
ca102bdc
echo
'2020-1-1 1:1:1'
,
'abc'
,
'device'
,
123
,
'9876'
,
'abc'
,
'net'
,
'mno'
,
'province'
,
'city'
,
'al'
>
C
:\\Windows\\Temp\\data.sql
echo
'2020-1-2 1:1:1'
,
'abc'
,
'device'
,
123
,
'9876'
,
'abc'
,
'net'
,
'mno'
,
'province'
,
'city'
,
'al'
>>
C
:\\Windows\\Temp\\data.sql
echo
'2020-1-3 1:1:1'
,
'abc'
,
'device'
,
123
,
'9876'
,
'abc'
,
'net'
,
'mno'
,
'province'
,
'city'
,
'al'
>>
C
:\\Windows\\Temp\\data.sql
tests/script/tsim/parser/import_file.sim
浏览文件 @
ca102bdc
...
...
@@ -7,8 +7,11 @@ sql drop database if exists indb
sql create database if not exists indb
sql use indb
$inFileName = '/tmp/data.csv'
$numOfRows = 10000
$inFileName = '/tmp/data.sql'
system_content printf %OS%
if $system_content == Windows_NT then
$inFileName = 'C:\\Windows\\Temp\\data.sql'
endi
system tsim/parser/gendata.sh
sql create table stbx (ts TIMESTAMP, collect_area NCHAR(12), device_id BINARY(16), imsi BINARY(16), imei BINARY(16), mdn BINARY(10), net_type BINARY(4), mno NCHAR(4), province NCHAR(10), city NCHAR(16), alarm BINARY(2)) tags(a int, b binary(12));
...
...
@@ -16,8 +19,8 @@ sql create table stbx (ts TIMESTAMP, collect_area NCHAR(12), device_id BINARY(16
sql create table tbx (ts TIMESTAMP, collect_area NCHAR(12), device_id BINARY(16), imsi BINARY(16), imei BINARY(16), mdn BINARY(10), net_type BINARY(4), mno NCHAR(4), province NCHAR(10), city NCHAR(16), alarm BINARY(2))
print ====== create tables success, starting insert data
sql insert into tbx file
'/tmp/data.sql'
sql import into tbx file
'/tmp/data.sql'
sql insert into tbx file
$inFileName
sql import into tbx file
$inFileName
sql select count(*) from tbx
if $rows != 1 then
...
...
@@ -31,8 +34,8 @@ endi
sql drop table tbx;
sql insert into tbx using stbx tags(1,'abc') file
'/tmp/data.sql'
;
sql insert into tbx using stbx tags(1,'abc') file
'/tmp/data.sql'
;
sql insert into tbx using stbx tags(1,'abc') file
$inFileName
;
sql insert into tbx using stbx tags(1,'abc') file
$inFileName
;
sql select count(*) from tbx
if $rows != 1 then
...
...
@@ -44,7 +47,7 @@ if $data00 != 3 then
endi
sql drop table tbx;
sql insert into tbx using stbx(b) tags('abcf') file
'/tmp/data.sql'
;
sql insert into tbx using stbx(b) tags('abcf') file
$inFileName
;
sql select ts,a,b from tbx;
if $rows != 3 then
...
...
@@ -64,6 +67,6 @@ if $data02 != @abcf@ then
return -1
endi
system rm -f
/tmp/data.sql
system rm -f
$inFileName
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/system-test/test-all.bat
浏览文件 @
ca102bdc
...
...
@@ -91,4 +91,5 @@ goto :eof
:CheckSkipCase
set
skipCase
=
false
if
"
%
*"
==
"python3 ./test.py -f 1-insert/insertWithMoreVgroup.py"
(
set
skipCase
=
true
)
echo
%
*
|
grep
"\-R"
&&
set
skipCase
=
true
:goto
eof
\ No newline at end of file
tests/system-test/test.py
浏览文件 @
ca102bdc
...
...
@@ -328,7 +328,7 @@ if __name__ == "__main__":
conn
=
taos
.
connect
(
host
,
config
=
tdDnodes
.
getSimCfgPath
())
else
:
conn
=
taosrest
.
connect
(
url
=
f
"http://
{
host
}
:6041"
)
tdLog
.
info
(
tdDnodes
.
getSimCfgPath
(),
host
)
#
tdLog.info(tdDnodes.getSimCfgPath(),host)
if
createDnodeNums
==
1
:
createDnodeNums
=
dnodeNums
else
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录