Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
5c2b0097
T
TDengine
项目概览
慢慢CG
/
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看板
提交
5c2b0097
编写于
7月 06, 2020
作者:
S
Steven Li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor tweak of crash_gen tool
上级
8eb30f62
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
5 deletion
+17
-5
src/wal/src/walMain.c
src/wal/src/walMain.c
+1
-0
tests/pytest/crash_gen.py
tests/pytest/crash_gen.py
+15
-4
tests/pytest/crash_gen.sh
tests/pytest/crash_gen.sh
+1
-1
未找到文件。
src/wal/src/walMain.c
浏览文件 @
5c2b0097
...
@@ -196,6 +196,7 @@ void walFsync(void *handle) {
...
@@ -196,6 +196,7 @@ void walFsync(void *handle) {
if
(
pWal
==
NULL
)
return
;
if
(
pWal
==
NULL
)
return
;
if
(
pWal
->
level
==
TAOS_WAL_FSYNC
&&
pWal
->
fd
>=
0
)
{
if
(
pWal
->
level
==
TAOS_WAL_FSYNC
&&
pWal
->
fd
>=
0
)
{
printf
(
"WAL-SYNC executed
\n
"
);
if
(
fsync
(
pWal
->
fd
)
<
0
)
{
if
(
fsync
(
pWal
->
fd
)
<
0
)
{
wError
(
"wal:%s, fsync failed(%s)"
,
pWal
->
name
,
strerror
(
errno
));
wError
(
"wal:%s, fsync failed(%s)"
,
pWal
->
name
,
strerror
(
errno
));
}
}
...
...
tests/pytest/crash_gen.py
浏览文件 @
5c2b0097
#!/usr/bin/python3.7
#
-----
!/usr/bin/python3.7
###################################################################
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
# All rights reserved.
...
@@ -25,6 +25,7 @@ if sys.version_info[0] < 3:
...
@@ -25,6 +25,7 @@ if sys.version_info[0] < 3:
import
getopt
import
getopt
import
argparse
import
argparse
import
copy
import
copy
import
requests
import
threading
import
threading
import
random
import
random
...
@@ -1061,8 +1062,11 @@ class DbManager():
...
@@ -1061,8 +1062,11 @@ class DbManager():
def
getNextTick
(
self
):
def
getNextTick
(
self
):
with
self
.
_lock
:
# prevent duplicate tick
with
self
.
_lock
:
# prevent duplicate tick
self
.
_lastTick
+=
datetime
.
timedelta
(
0
,
1
)
# add one second to it
if
Dice
.
throw
(
10
)
==
0
:
# 1 in 10 chance
return
self
.
_lastTick
return
self
.
_lastTick
+
datetime
.
timedelta
(
0
,
-
100
)
else
:
# regular
self
.
_lastTick
+=
datetime
.
timedelta
(
0
,
1
)
# add one second to it
return
self
.
_lastTick
def
getNextInt
(
self
):
def
getNextInt
(
self
):
with
self
.
_lock
:
with
self
.
_lock
:
...
@@ -1220,7 +1224,12 @@ class Task():
...
@@ -1220,7 +1224,12 @@ class Task():
# sys.exit(-1)
# sys.exit(-1)
self
.
_err
=
err
self
.
_err
=
err
self
.
_aborted
=
True
self
.
_aborted
=
True
except
:
except
Exception
as
e
:
self
.
logInfo
(
"Non-TAOS exception encountered"
)
self
.
_err
=
e
self
.
_aborted
=
True
traceback
.
print_exc
()
except
:
self
.
logDebug
(
"[=] Unexpected exception, SQL: {}"
.
format
(
self
.
_lastSql
))
self
.
logDebug
(
"[=] Unexpected exception, SQL: {}"
.
format
(
self
.
_lastSql
))
raise
raise
self
.
_execStats
.
endTaskType
(
self
.
__class__
.
__name__
,
self
.
isSuccess
())
self
.
_execStats
.
endTaskType
(
self
.
__class__
.
__name__
,
self
.
isSuccess
())
...
@@ -1699,6 +1708,8 @@ class ClientManager:
...
@@ -1699,6 +1708,8 @@ class ClientManager:
dbc
=
dbManager
.
getDbConn
()
dbc
=
dbManager
.
getDbConn
()
if
dbc
.
query
(
"show databases"
)
==
0
:
# no databae
if
dbc
.
query
(
"show databases"
)
==
0
:
# no databae
return
return
if
dbc
.
query
(
"show tables"
)
==
0
:
# no tables
return
dbc
.
execute
(
"use db"
)
dbc
.
execute
(
"use db"
)
sTbName
=
dbManager
.
getFixedSuperTableName
()
sTbName
=
dbManager
.
getFixedSuperTableName
()
...
...
tests/pytest/crash_gen.sh
浏览文件 @
5c2b0097
...
@@ -38,4 +38,4 @@ export PYTHONPATH=$(pwd)/../../src/connector/python/linux/python3
...
@@ -38,4 +38,4 @@ export PYTHONPATH=$(pwd)/../../src/connector/python/linux/python3
export
LD_LIBRARY_PATH
=
$LD_LIBRARY_PATH
:
$(
pwd
)
/../../build/build/lib
export
LD_LIBRARY_PATH
=
$LD_LIBRARY_PATH
:
$(
pwd
)
/../../build/build/lib
# Now we are all let, and let's see if we can find a crash. Note we pass all params
# Now we are all let, and let's see if we can find a crash. Note we pass all params
./crash_gen.py
$@
python3
./crash_gen.py
$@
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录