Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
99c04425
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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,发现更多精彩内容 >>
未验证
提交
99c04425
编写于
6月 28, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
6月 28, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2467 from taosdata/hotfix/crash
revert crash_gen.py
上级
eb4f9c51
abb55ed0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
62 addition
and
75 deletion
+62
-75
tests/pytest/crash_gen.py
tests/pytest/crash_gen.py
+62
-75
未找到文件。
tests/pytest/crash_gen.py
浏览文件 @
99c04425
...
...
@@ -686,8 +686,7 @@ class StateHasData(AnyState):
self
.
assertNoTask
(
tasks
,
TaskAddData
)
# self.hasSuccess(tasks, DeleteDataTasks)
else
:
# should be STATE_HAS_DATA
if
(
not
self
.
hasTask
(
tasks
,
TaskCreateDb
)
):
# only if we didn't create one
self
.
assertNoTask
(
tasks
,
TaskDropDb
)
# we shouldn't have dropped it
self
.
assertNoTask
(
tasks
,
TaskDropDb
)
if
(
not
self
.
hasTask
(
tasks
,
TaskCreateSuperTable
))
:
# if we didn't create the table
self
.
assertNoTask
(
tasks
,
TaskDropSuperTable
)
# we should not have a task that drops it
# self.assertIfExistThenSuccess(tasks, ReadFixedDataTask)
...
...
@@ -1296,67 +1295,7 @@ class LoggingFilter(logging.Filter):
# return False
return
True
class
MainExec
:
@
classmethod
def
runClient
(
cls
):
# resetDb = False # DEBUG only
# dbState = DbState(resetDb) # DBEUG only!
dbManager
=
DbManager
()
# Regular function
Dice
.
seed
(
0
)
# initial seeding of dice
thPool
=
ThreadPool
(
gConfig
.
num_threads
,
gConfig
.
max_steps
)
tc
=
ThreadCoordinator
(
thPool
,
dbManager
)
tc
.
run
()
tc
.
logStats
()
dbManager
.
cleanUp
()
@
classmethod
def
runService
(
cls
):
print
(
"Running service..."
)
@
classmethod
def
runTemp
(
cls
):
# for debugging purposes
# # Hack to exercise reading from disk, imcreasing coverage. TODO: fix
# dbc = dbState.getDbConn()
# sTbName = dbState.getFixedSuperTableName()
# dbc.execute("create database if not exists db")
# if not dbState.getState().equals(StateEmpty()):
# dbc.execute("use db")
# rTables = None
# try: # the super table may not exist
# sql = "select TBNAME from db.{}".format(sTbName)
# logger.info("Finding out tables in super table: {}".format(sql))
# dbc.query(sql) # TODO: analyze result set later
# logger.info("Fetching result")
# rTables = dbc.getQueryResult()
# logger.info("Result: {}".format(rTables))
# except taos.error.ProgrammingError as err:
# logger.info("Initial Super table OPS error: {}".format(err))
# # sys.exit()
# if ( not rTables == None):
# # print("rTables[0] = {}, type = {}".format(rTables[0], type(rTables[0])))
# try:
# for rTbName in rTables : # regular tables
# ds = dbState
# logger.info("Inserting into table: {}".format(rTbName[0]))
# sql = "insert into db.{} values ('{}', {});".format(
# rTbName[0],
# ds.getNextTick(), ds.getNextInt())
# dbc.execute(sql)
# for rTbName in rTables : # regular tables
# dbc.query("select * from db.{}".format(rTbName[0])) # TODO: check success failure
# logger.info("Initial READING operation is successful")
# except taos.error.ProgrammingError as err:
# logger.info("Initial WRITE/READ error: {}".format(err))
# Sandbox testing code
# dbc = dbState.getDbConn()
# while True:
# rows = dbc.query("show databases")
# print("Rows: {}, time={}".format(rows, time.time()))
return
def
main
():
# Super cool Python argument library: https://docs.python.org/3/library/argparse.html
...
...
@@ -1369,27 +1308,24 @@ def main():
2. You run the server there before this script: ./build/bin/taosd -c test/cfg
'''
))
parser
.
add_argument
(
'-d'
,
'--debug'
,
action
=
'store_true'
,
help
=
'Turn on DEBUG mode for more logging (default: false)'
)
parser
.
add_argument
(
'-e'
,
'--run-tdengine'
,
action
=
'store_true'
,
help
=
'Run TDengine service in foreground (default: false)'
)
parser
.
add_argument
(
'-l'
,
'--larger-data'
,
action
=
'store_true'
,
help
=
'Write larger amount of data during write operations (default: false)'
)
parser
.
add_argument
(
'-p'
,
'--per-thread-db-connection'
,
action
=
'store_
fals
e'
,
parser
.
add_argument
(
'-p'
,
'--per-thread-db-connection'
,
action
=
'store_
tru
e'
,
help
=
'Use a single shared db connection (default: false)'
)
parser
.
add_argument
(
'-r'
,
'--record-ops'
,
action
=
'store_true'
,
help
=
'Use a pair of always-fsynced fils to record operations performing + performed, for power-off tests (default: false)'
)
parser
.
add_argument
(
'-s'
,
'--max-steps'
,
action
=
'store'
,
default
=
100
0
,
type
=
int
,
parser
.
add_argument
(
'-s'
,
'--max-steps'
,
action
=
'store'
,
default
=
100
,
type
=
int
,
help
=
'Maximum number of steps to run (default: 100)'
)
parser
.
add_argument
(
'-t'
,
'--num-threads'
,
action
=
'store'
,
default
=
5
,
type
=
int
,
parser
.
add_argument
(
'-t'
,
'--num-threads'
,
action
=
'store'
,
default
=
10
,
type
=
int
,
help
=
'Number of threads to run (default: 10)'
)
global
gConfig
gConfig
=
parser
.
parse_args
()
#
if len(sys.argv) == 1:
#
parser.print_help()
#
sys.exit()
if
len
(
sys
.
argv
)
==
1
:
parser
.
print_help
()
sys
.
exit
()
global
logger
logger
=
logging
.
getLogger
(
'CrashGen'
)
...
...
@@ -1401,11 +1337,62 @@ def main():
ch
=
logging
.
StreamHandler
()
logger
.
addHandler
(
ch
)
if
gConfig
.
run_tdengine
:
# run server
MainExec
.
runService
()
else
:
MainExec
.
runClient
()
# resetDb = False # DEBUG only
# dbState = DbState(resetDb) # DBEUG only!
dbManager
=
DbManager
()
# Regular function
Dice
.
seed
(
0
)
# initial seeding of dice
tc
=
ThreadCoordinator
(
ThreadPool
(
gConfig
.
num_threads
,
gConfig
.
max_steps
),
# WorkDispatcher(dbState), # Obsolete?
dbManager
)
# # Hack to exercise reading from disk, imcreasing coverage. TODO: fix
# dbc = dbState.getDbConn()
# sTbName = dbState.getFixedSuperTableName()
# dbc.execute("create database if not exists db")
# if not dbState.getState().equals(StateEmpty()):
# dbc.execute("use db")
# rTables = None
# try: # the super table may not exist
# sql = "select TBNAME from db.{}".format(sTbName)
# logger.info("Finding out tables in super table: {}".format(sql))
# dbc.query(sql) # TODO: analyze result set later
# logger.info("Fetching result")
# rTables = dbc.getQueryResult()
# logger.info("Result: {}".format(rTables))
# except taos.error.ProgrammingError as err:
# logger.info("Initial Super table OPS error: {}".format(err))
# # sys.exit()
# if ( not rTables == None):
# # print("rTables[0] = {}, type = {}".format(rTables[0], type(rTables[0])))
# try:
# for rTbName in rTables : # regular tables
# ds = dbState
# logger.info("Inserting into table: {}".format(rTbName[0]))
# sql = "insert into db.{} values ('{}', {});".format(
# rTbName[0],
# ds.getNextTick(), ds.getNextInt())
# dbc.execute(sql)
# for rTbName in rTables : # regular tables
# dbc.query("select * from db.{}".format(rTbName[0])) # TODO: check success failure
# logger.info("Initial READING operation is successful")
# except taos.error.ProgrammingError as err:
# logger.info("Initial WRITE/READ error: {}".format(err))
# Sandbox testing code
# dbc = dbState.getDbConn()
# while True:
# rows = dbc.query("show databases")
# print("Rows: {}, time={}".format(rows, time.time()))
tc
.
run
()
tc
.
logStats
()
dbManager
.
cleanUp
()
# logger.info("Crash_Gen execution finished")
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录