Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0ff7bcc0
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
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看板
提交
0ff7bcc0
编写于
8月 31, 2021
作者:
J
jiajingbin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add testcases for issue-7666
上级
18e2f570
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
60 addition
and
9 deletion
+60
-9
tests/pytest/insert/verifyMemToDiskCrash.py
tests/pytest/insert/verifyMemToDiskCrash.py
+60
-9
未找到文件。
tests/pytest/insert/verifyMemToDiskCrash.py
浏览文件 @
0ff7bcc0
...
@@ -13,16 +13,14 @@
...
@@ -13,16 +13,14 @@
from
util.log
import
tdLog
from
util.log
import
tdLog
from
util.cases
import
tdCases
from
util.cases
import
tdCases
from
util.sql
import
tdSql
from
util.sql
import
tdSql
import
time
from
util.common
import
tdCom
from
util.common
import
tdCom
class
TDTestCase
:
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
checkMemDiskMerge
(
self
):
def
check
Tb
MemDiskMerge
(
self
):
tb_name
=
tdCom
.
getLongName
(
8
,
"letters"
)
tb_name
=
tdCom
.
getLongName
(
8
,
"letters"
)
tdSql
.
execute
(
tdSql
.
execute
(
f
'CREATE TABLE
{
tb_name
}
(ts timestamp, c1 int, c2 int)'
)
f
'CREATE TABLE
{
tb_name
}
(ts timestamp, c1 int, c2 int)'
)
...
@@ -41,8 +39,32 @@ class TDTestCase:
...
@@ -41,8 +39,32 @@ class TDTestCase:
res2
=
tdSql
.
query
(
query_sql
,
True
)
res2
=
tdSql
.
query
(
query_sql
,
True
)
for
i
in
range
(
4
):
for
i
in
range
(
4
):
tdSql
.
checkEqual
(
res1
[
i
],
res2
[
i
])
tdSql
.
checkEqual
(
res1
[
i
],
res2
[
i
])
def
checkStbMemDiskMerge
(
self
):
tdCom
.
cleanTb
()
stb_name
=
tdCom
.
getLongName
(
8
,
"letters"
)
tb_name
=
tdCom
.
getLongName
(
7
,
"letters"
)
tdSql
.
execute
(
f
'CREATE TABLE
{
stb_name
}
(ts timestamp, c1 int, c2 int) tags (t1 int)'
)
tdSql
.
execute
(
f
'CREATE TABLE
{
tb_name
}
using
{
stb_name
}
tags (1)'
)
tdSql
.
execute
(
f
'insert into
{
tb_name
}
values ("2021-01-01 12:00:00.000", 1, 1)'
)
tdSql
.
execute
(
f
'insert into
{
tb_name
}
values ("2021-01-03 12:00:00.000", 3, 3)'
)
tdCom
.
restartTaosd
()
tdSql
.
execute
(
f
'insert into
{
tb_name
}
values ("2021-01-02 12:00:00.000", Null, 2)'
)
tdSql
.
execute
(
f
'insert into
{
tb_name
}
values ("2021-01-04 12:00:00.000", Null, 4)'
)
query_sql
=
f
'select * from
{
stb_name
}
'
res1
=
tdSql
.
query
(
query_sql
,
True
)
tdCom
.
restartTaosd
()
res2
=
tdSql
.
query
(
query_sql
,
True
)
for
i
in
range
(
4
):
tdSql
.
checkEqual
(
res1
[
i
],
res2
[
i
])
def
checkSuperSubBlockMerge
(
self
):
def
check
Tb
SuperSubBlockMerge
(
self
):
tdCom
.
cleanTb
()
tdCom
.
cleanTb
()
tb_name
=
tdCom
.
getLongName
(
8
,
"letters"
)
tb_name
=
tdCom
.
getLongName
(
8
,
"letters"
)
tdSql
.
execute
(
tdSql
.
execute
(
...
@@ -55,14 +77,12 @@ class TDTestCase:
...
@@ -55,14 +77,12 @@ class TDTestCase:
start_ts
+=
1
start_ts
+=
1
tdCom
.
restartTaosd
()
tdCom
.
restartTaosd
()
tdSql
.
query
(
f
'select * from
{
tb_name
}
'
)
for
i
in
range
(
10
):
for
i
in
range
(
10
):
tdSql
.
execute
(
tdSql
.
execute
(
f
'insert into
{
tb_name
}
values (
{
start_ts
}
, Null)'
)
f
'insert into
{
tb_name
}
values (
{
start_ts
}
, Null)'
)
start_ts
+=
1
start_ts
+=
1
tdCom
.
restartTaosd
()
tdCom
.
restartTaosd
()
tdSql
.
query
(
f
'select * from
{
tb_name
}
'
)
for
i
in
range
(
10
):
for
i
in
range
(
10
):
new_ts
=
i
+
10
+
10
new_ts
=
i
+
10
+
10
tdSql
.
execute
(
tdSql
.
execute
(
...
@@ -71,11 +91,42 @@ class TDTestCase:
...
@@ -71,11 +91,42 @@ class TDTestCase:
tdCom
.
restartTaosd
()
tdCom
.
restartTaosd
()
tdSql
.
query
(
f
'select * from
{
tb_name
}
'
)
tdSql
.
query
(
f
'select * from
{
tb_name
}
'
)
def
checkStbSuperSubBlockMerge
(
self
):
tdCom
.
cleanTb
()
stb_name
=
tdCom
.
getLongName
(
8
,
"letters"
)
tb_name
=
tdCom
.
getLongName
(
7
,
"letters"
)
tdSql
.
execute
(
f
'CREATE TABLE
{
stb_name
}
(ts timestamp, c1 int) tags (t1 int)'
)
tdSql
.
execute
(
f
'CREATE TABLE
{
tb_name
}
using
{
stb_name
}
tags (1)'
)
start_ts
=
1577808001000
for
i
in
range
(
79
):
tdSql
.
execute
(
f
'insert into
{
tb_name
}
values (
{
start_ts
}
,
{
i
}
)'
)
start_ts
+=
1
tdCom
.
restartTaosd
()
for
i
in
range
(
10
):
tdSql
.
execute
(
f
'insert into
{
tb_name
}
values (
{
start_ts
}
, Null)'
)
start_ts
+=
1
tdCom
.
restartTaosd
()
for
i
in
range
(
10
):
new_ts
=
i
+
10
+
10
tdSql
.
execute
(
f
'insert into
{
tb_name
}
values (
{
start_ts
}
,
{
new_ts
}
)'
)
start_ts
+=
1
tdCom
.
restartTaosd
()
tdSql
.
query
(
f
'select * from
{
stb_name
}
'
)
def
run
(
self
):
def
run
(
self
):
tdSql
.
prepare
()
tdSql
.
prepare
()
# self.checkMemDiskMerge()
self
.
checkTbMemDiskMerge
()
self
.
checkSuperSubBlockMerge
()
self
.
checkStbMemDiskMerge
()
self
.
checkTbSuperSubBlockMerge
()
self
.
checkStbSuperSubBlockMerge
()
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录