Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Rattenking
TDengine
提交
ac1fb970
T
TDengine
项目概览
Rattenking
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ac1fb970
编写于
6月 09, 2020
作者:
S
Steven Li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added overlaping data insertion, plus occasional db connection drops
上级
2e2a3f10
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
7 deletion
+24
-7
tests/pytest/crash_gen.py
tests/pytest/crash_gen.py
+24
-7
未找到文件。
tests/pytest/crash_gen.py
浏览文件 @
ac1fb970
...
...
@@ -32,6 +32,7 @@ import textwrap
from
typing
import
List
from
typing
import
Dict
from
typing
import
Set
from
util.log
import
*
from
util.dnodes
import
*
...
...
@@ -969,7 +970,7 @@ class Task():
self
.
_executeInternal
(
te
,
wt
)
# TODO: no return value?
except
taos
.
error
.
ProgrammingError
as
err
:
self
.
logDebug
(
"[=] Taos library exception: errno={:X}, msg: {}"
.
format
(
err
.
errno
,
err
))
self
.
_err
=
err
self
.
_err
=
err
except
:
self
.
logDebug
(
"[=] Unexpected exception"
)
raise
...
...
@@ -1136,10 +1137,14 @@ class ReadFixedDataTask(StateTransitionTask):
sTbName
=
self
.
_dbState
.
getFixedSuperTableName
()
dbc
=
wt
.
getDbConn
()
dbc
.
query
(
"select TBNAME from db.{}"
.
format
(
sTbName
))
# TODO: analyze result set later
rTables
=
dbc
.
getQueryResult
()
# print("rTables[0] = {}, type = {}".format(rTables[0], type(rTables[0])))
for
rTbName
in
rTables
:
# regular tables
dbc
.
query
(
"select * from db.{}"
.
format
(
rTbName
[
0
]))
# TODO: check success failure
if
random
.
randrange
(
5
)
==
0
:
# 1 in 5 chance, simulate a broken connection. TODO: break connection in all situations
dbc
.
close
()
dbc
.
open
()
else
:
rTables
=
dbc
.
getQueryResult
()
# print("rTables[0] = {}, type = {}".format(rTables[0], type(rTables[0])))
for
rTbName
in
rTables
:
# regular tables
dbc
.
query
(
"select * from db.{}"
.
format
(
rTbName
[
0
]))
# TODO: check success failure
# tdSql.query(" cars where tbname in ('carzero', 'carone')")
...
...
@@ -1160,6 +1165,8 @@ class DropFixedSuperTableTask(StateTransitionTask):
wt
.
execSql
(
"drop table db.{}"
.
format
(
tblName
))
class
AddFixedDataTask
(
StateTransitionTask
):
activeTable
:
Set
[
int
]
=
set
()
# Track which table is being actively worked on
@
classmethod
def
getInfo
(
cls
):
return
[
...
...
@@ -1174,14 +1181,24 @@ class AddFixedDataTask(StateTransitionTask):
def
_executeInternal
(
self
,
te
:
TaskExecutor
,
wt
:
WorkerThread
):
ds
=
self
.
_dbState
wt
.
execSql
(
"use db"
)
# TODO: seems to be an INSERT bug to require this
for
i
in
range
(
35
if
gConfig
.
larger_data
else
2
):
# number of regular tables in the super table
for
j
in
range
(
100
if
gConfig
.
larger_data
else
2
)
:
# number of records per table
tblSeq
=
list
(
range
(
35
if
gConfig
.
larger_data
else
2
))
random
.
shuffle
(
tblSeq
)
for
i
in
tblSeq
:
if
(
i
in
self
.
activeTable
):
# wow already active
# logger.info("Concurrent data insertion into table: {}".format(i))
# print("ct({})".format(i), end="", flush=True) # Concurrent insertion into table
print
(
"x"
,
end
=
""
,
flush
=
True
)
else
:
self
.
activeTable
.
add
(
i
)
# marking it active
# No need to shuffle data sequence, unless later we decide to do non-increment insertion
for
j
in
range
(
50
if
gConfig
.
larger_data
else
2
)
:
# number of records per table
sql
=
"insert into db.reg_table_{} using {} tags ('{}', {}) values ('{}', {});"
.
format
(
i
,
ds
.
getFixedSuperTableName
(),
ds
.
getNextBinary
(),
ds
.
getNextFloat
(),
ds
.
getNextTick
(),
ds
.
getNextInt
())
wt
.
execSql
(
sql
)
self
.
activeTable
.
discard
(
i
)
# not raising an error, unlike remove
#---------- Non State-Transition Related Tasks ----------#
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录