Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
24f106c6
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看板
提交
24f106c6
编写于
12月 24, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/develop' into feature/sim
上级
5adcb887
ee9b0063
变更
54
隐藏空白更改
内联
并排
Showing
54 changed file
with
139 addition
and
81 deletion
+139
-81
packaging/tools/set_core.sh
packaging/tools/set_core.sh
+24
-4
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+3
-0
src/query/inc/qHistogram.h
src/query/inc/qHistogram.h
+1
-1
src/query/src/qHistogram.c
src/query/src/qHistogram.c
+0
-1
src/query/tests/histogramTest.cpp
src/query/tests/histogramTest.cpp
+5
-5
src/tsdb/src/tsdbCommit.c
src/tsdb/src/tsdbCommit.c
+5
-0
src/tsdb/src/tsdbMemTable.c
src/tsdb/src/tsdbMemTable.c
+13
-13
tests/pytest/crash_gen/crash_gen_main.py
tests/pytest/crash_gen/crash_gen_main.py
+11
-8
tests/pytest/crash_gen/db.py
tests/pytest/crash_gen/db.py
+9
-1
tests/pytest/crash_gen/misc.py
tests/pytest/crash_gen/misc.py
+2
-1
tests/pytest/crash_gen_bootstrap.py
tests/pytest/crash_gen_bootstrap.py
+1
-1
tests/pytest/import_merge/importCacheFileH.py
tests/pytest/import_merge/importCacheFileH.py
+1
-1
tests/pytest/import_merge/importCacheFileHO.py
tests/pytest/import_merge/importCacheFileHO.py
+1
-1
tests/pytest/import_merge/importCacheFileHPO.py
tests/pytest/import_merge/importCacheFileHPO.py
+1
-1
tests/pytest/import_merge/importCacheFileS.py
tests/pytest/import_merge/importCacheFileS.py
+1
-1
tests/pytest/import_merge/importCacheFileSub.py
tests/pytest/import_merge/importCacheFileSub.py
+1
-1
tests/pytest/import_merge/importCacheFileT.py
tests/pytest/import_merge/importCacheFileT.py
+1
-1
tests/pytest/import_merge/importCacheFileTO.py
tests/pytest/import_merge/importCacheFileTO.py
+1
-1
tests/pytest/import_merge/importCacheFileTPO.py
tests/pytest/import_merge/importCacheFileTPO.py
+1
-1
tests/pytest/import_merge/importDataH2.py
tests/pytest/import_merge/importDataH2.py
+1
-1
tests/pytest/import_merge/importDataHO.py
tests/pytest/import_merge/importDataHO.py
+1
-1
tests/pytest/import_merge/importDataHO2.py
tests/pytest/import_merge/importDataHO2.py
+1
-1
tests/pytest/import_merge/importDataHPO.py
tests/pytest/import_merge/importDataHPO.py
+1
-1
tests/pytest/import_merge/importDataLastH.py
tests/pytest/import_merge/importDataLastH.py
+1
-1
tests/pytest/import_merge/importDataLastHO.py
tests/pytest/import_merge/importDataLastHO.py
+1
-1
tests/pytest/import_merge/importDataLastHPO.py
tests/pytest/import_merge/importDataLastHPO.py
+1
-1
tests/pytest/import_merge/importDataLastS.py
tests/pytest/import_merge/importDataLastS.py
+1
-1
tests/pytest/import_merge/importDataLastSub.py
tests/pytest/import_merge/importDataLastSub.py
+3
-3
tests/pytest/import_merge/importDataLastT.py
tests/pytest/import_merge/importDataLastT.py
+1
-1
tests/pytest/import_merge/importDataLastTO.py
tests/pytest/import_merge/importDataLastTO.py
+1
-1
tests/pytest/import_merge/importDataLastTPO.py
tests/pytest/import_merge/importDataLastTPO.py
+1
-1
tests/pytest/import_merge/importDataS.py
tests/pytest/import_merge/importDataS.py
+1
-1
tests/pytest/import_merge/importDataSub.py
tests/pytest/import_merge/importDataSub.py
+1
-1
tests/pytest/import_merge/importDataT.py
tests/pytest/import_merge/importDataT.py
+1
-1
tests/pytest/import_merge/importDataTO.py
tests/pytest/import_merge/importDataTO.py
+1
-1
tests/pytest/import_merge/importDataTPO.py
tests/pytest/import_merge/importDataTPO.py
+2
-2
tests/pytest/import_merge/importHORestart.py
tests/pytest/import_merge/importHORestart.py
+1
-1
tests/pytest/import_merge/importHPORestart.py
tests/pytest/import_merge/importHPORestart.py
+1
-1
tests/pytest/import_merge/importHRestart.py
tests/pytest/import_merge/importHRestart.py
+1
-1
tests/pytest/import_merge/importInsertThenImport.py
tests/pytest/import_merge/importInsertThenImport.py
+1
-1
tests/pytest/import_merge/importLastH.py
tests/pytest/import_merge/importLastH.py
+1
-1
tests/pytest/import_merge/importLastHO.py
tests/pytest/import_merge/importLastHO.py
+1
-1
tests/pytest/import_merge/importLastHPO.py
tests/pytest/import_merge/importLastHPO.py
+1
-1
tests/pytest/import_merge/importLastS.py
tests/pytest/import_merge/importLastS.py
+1
-1
tests/pytest/import_merge/importLastSub.py
tests/pytest/import_merge/importLastSub.py
+1
-1
tests/pytest/import_merge/importLastT.py
tests/pytest/import_merge/importLastT.py
+1
-1
tests/pytest/import_merge/importLastTO.py
tests/pytest/import_merge/importLastTO.py
+1
-1
tests/pytest/import_merge/importLastTPO.py
tests/pytest/import_merge/importLastTPO.py
+1
-1
tests/pytest/import_merge/importSRestart.py
tests/pytest/import_merge/importSRestart.py
+1
-1
tests/pytest/import_merge/importSubRestart.py
tests/pytest/import_merge/importSubRestart.py
+1
-1
tests/pytest/import_merge/importTORestart.py
tests/pytest/import_merge/importTORestart.py
+1
-1
tests/pytest/import_merge/importTPORestart.py
tests/pytest/import_merge/importTPORestart.py
+1
-1
tests/pytest/import_merge/importTRestart.py
tests/pytest/import_merge/importTRestart.py
+1
-1
tests/pytest/query/query.py
tests/pytest/query/query.py
+20
-1
未找到文件。
packaging/tools/set_core.sh
浏览文件 @
24f106c6
...
@@ -2,19 +2,39 @@
...
@@ -2,19 +2,39 @@
#
#
# This file is used to set config for core when taosd crash
# This file is used to set config for core when taosd crash
# Color setting
RED
=
'\033[0;31m'
GREEN
=
'\033[1;32m'
GREEN_DARK
=
'\033[0;32m'
GREEN_UNDERLINE
=
'\033[4;32m'
NC
=
'\033[0m'
set
-e
set
-e
# set -x
# set -x
corePath
=
$1
csudo
=
""
csudo
=
""
if
command
-v
sudo
>
/dev/null
;
then
if
command
-v
sudo
>
/dev/null
;
then
csudo
=
"sudo"
csudo
=
"sudo"
fi
fi
#ulimit -c unlimited
if
[[
!
-n
${
corePath
}
]]
;
then
echo
-e
-n
"
${
GREEN
}
Please enter a file directory to save the coredump file
${
NC
}
:"
read
corePath
while
true
;
do
if
[[
!
-z
"
$corePath
"
]]
;
then
break
else
read
-p
"Please enter a file directory to save the coredump file:"
corePath
fi
done
fi
ulimit
-c
unlimited
${
csudo
}
sed
-i
'/ulimit -c unlimited/d'
/etc/profile
||
:
${
csudo
}
sed
-i
'/ulimit -c unlimited/d'
/etc/profile
||
:
${
csudo
}
sed
-i
'$a\ulimit -c unlimited'
/etc/profile
||
:
${
csudo
}
sed
-i
'$a\ulimit -c unlimited'
/etc/profile
||
:
source
/etc/profile
source
/etc/profile
${
csudo
}
mkdir
-p
/coredump
||
:
${
csudo
}
mkdir
-p
${
corePath
}
||
:
${
csudo
}
sysctl
-w
kernel.core_pattern
=
'/coredump/core-%e-%p'
||
:
${
csudo
}
sysctl
-w
kernel.core_pattern
=
${
corePath
}
/core-%e-%p
||
:
${
csudo
}
echo
'/coredump/core-%e-%p'
|
${
csudo
}
tee
/proc/sys/kernel/core_pattern
||
:
${
csudo
}
echo
"
${
corePath
}
/core-%e-%p"
|
${
csudo
}
tee
/proc/sys/kernel/core_pattern
||
:
src/kit/taosdump/taosdump.c
浏览文件 @
24f106c6
...
@@ -332,6 +332,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
...
@@ -332,6 +332,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
break
;
break
;
case
'N'
:
case
'N'
:
arguments
->
data_batch
=
atoi
(
arg
);
arguments
->
data_batch
=
atoi
(
arg
);
if
(
arguments
->
data_batch
>=
INT16_MAX
)
{
arguments
->
data_batch
=
INT16_MAX
-
1
;
}
break
;
break
;
case
'L'
:
case
'L'
:
{
{
...
...
src/query/inc/qHistogram.h
浏览文件 @
24f106c6
...
@@ -67,7 +67,7 @@ void tHistogramDestroy(SHistogramInfo** pHisto);
...
@@ -67,7 +67,7 @@ void tHistogramDestroy(SHistogramInfo** pHisto);
void
tHistogramPrint
(
SHistogramInfo
*
pHisto
);
void
tHistogramPrint
(
SHistogramInfo
*
pHisto
);
//
int32_t histoBinarySearch(SHistBin* pEntry, int32_t len, double val);
int32_t
histoBinarySearch
(
SHistBin
*
pEntry
,
int32_t
len
,
double
val
);
SHeapEntry
*
tHeapCreate
(
int32_t
numOfEntries
);
SHeapEntry
*
tHeapCreate
(
int32_t
numOfEntries
);
void
tHeapSort
(
SHeapEntry
*
pEntry
,
int32_t
len
);
void
tHeapSort
(
SHeapEntry
*
pEntry
,
int32_t
len
);
...
...
src/query/src/qHistogram.c
浏览文件 @
24f106c6
...
@@ -120,7 +120,6 @@
...
@@ -120,7 +120,6 @@
//}
//}
static
int32_t
histogramCreateBin
(
SHistogramInfo
*
pHisto
,
int32_t
index
,
double
val
);
static
int32_t
histogramCreateBin
(
SHistogramInfo
*
pHisto
,
int32_t
index
,
double
val
);
static
int32_t
histoBinarySearch
(
SHistBin
*
pEntry
,
int32_t
len
,
double
val
);
SHistogramInfo
*
tHistogramCreate
(
int32_t
numOfEntries
)
{
SHistogramInfo
*
tHistogramCreate
(
int32_t
numOfEntries
)
{
/* need one redundant slot */
/* need one redundant slot */
...
...
src/query/tests/histogramTest.cpp
浏览文件 @
24f106c6
...
@@ -21,19 +21,19 @@ TEST(testCase, histogram_binary_search) {
...
@@ -21,19 +21,19 @@ TEST(testCase, histogram_binary_search) {
pHisto
->
elems
[
i
].
val
=
i
;
pHisto
->
elems
[
i
].
val
=
i
;
}
}
int32_t
idx
=
vnodeHistob
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
1
);
int32_t
idx
=
histoB
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
1
);
assert
(
idx
==
1
);
assert
(
idx
==
1
);
idx
=
vnodeHistob
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
9
);
idx
=
histoB
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
9
);
assert
(
idx
==
9
);
assert
(
idx
==
9
);
idx
=
vnodeHistob
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
20
);
idx
=
histoB
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
20
);
assert
(
idx
==
10
);
assert
(
idx
==
10
);
idx
=
vnodeHistob
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
-
1
);
idx
=
histoB
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
-
1
);
assert
(
idx
==
0
);
assert
(
idx
==
0
);
idx
=
vnodeHistob
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
3.9
);
idx
=
histoB
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
3.9
);
assert
(
idx
==
4
);
assert
(
idx
==
4
);
free
(
pHisto
);
free
(
pHisto
);
...
...
src/tsdb/src/tsdbCommit.c
浏览文件 @
24f106c6
...
@@ -161,6 +161,11 @@ _err:
...
@@ -161,6 +161,11 @@ _err:
static
void
tsdbEndCommit
(
STsdbRepo
*
pRepo
,
int
eno
)
{
static
void
tsdbEndCommit
(
STsdbRepo
*
pRepo
,
int
eno
)
{
if
(
pRepo
->
appH
.
notifyStatus
)
pRepo
->
appH
.
notifyStatus
(
pRepo
->
appH
.
appH
,
TSDB_STATUS_COMMIT_OVER
,
eno
);
if
(
pRepo
->
appH
.
notifyStatus
)
pRepo
->
appH
.
notifyStatus
(
pRepo
->
appH
.
appH
,
TSDB_STATUS_COMMIT_OVER
,
eno
);
SMemTable
*
pIMem
=
pRepo
->
imem
;
tsdbLockRepo
(
pRepo
);
pRepo
->
imem
=
NULL
;
tsdbUnlockRepo
(
pRepo
);
tsdbUnRefMemTable
(
pRepo
,
pIMem
);
sem_post
(
&
(
pRepo
->
readyToCommit
));
sem_post
(
&
(
pRepo
->
readyToCommit
));
}
}
...
...
src/tsdb/src/tsdbMemTable.c
浏览文件 @
24f106c6
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include "tsdbMain.h"
#include "tsdbMain.h"
#define TSDB_DATA_SKIPLIST_LEVEL 5
#define TSDB_DATA_SKIPLIST_LEVEL 5
#define TSDB_MAX_INSERT_BATCH 512
static
SMemTable
*
tsdbNewMemTable
(
STsdbRepo
*
pRepo
);
static
SMemTable
*
tsdbNewMemTable
(
STsdbRepo
*
pRepo
);
static
void
tsdbFreeMemTable
(
SMemTable
*
pMemTable
);
static
void
tsdbFreeMemTable
(
SMemTable
*
pMemTable
);
...
@@ -205,7 +206,7 @@ void *tsdbAllocBytes(STsdbRepo *pRepo, int bytes) {
...
@@ -205,7 +206,7 @@ void *tsdbAllocBytes(STsdbRepo *pRepo, int bytes) {
int
tsdbAsyncCommit
(
STsdbRepo
*
pRepo
)
{
int
tsdbAsyncCommit
(
STsdbRepo
*
pRepo
)
{
if
(
pRepo
->
mem
==
NULL
)
return
0
;
if
(
pRepo
->
mem
==
NULL
)
return
0
;
SMemTable
*
pIMem
=
pRepo
->
imem
;
ASSERT
(
pRepo
->
imem
==
NULL
)
;
sem_wait
(
&
(
pRepo
->
readyToCommit
));
sem_wait
(
&
(
pRepo
->
readyToCommit
));
...
@@ -220,8 +221,6 @@ int tsdbAsyncCommit(STsdbRepo *pRepo) {
...
@@ -220,8 +221,6 @@ int tsdbAsyncCommit(STsdbRepo *pRepo) {
tsdbScheduleCommit
(
pRepo
);
tsdbScheduleCommit
(
pRepo
);
if
(
tsdbUnlockRepo
(
pRepo
)
<
0
)
return
-
1
;
if
(
tsdbUnlockRepo
(
pRepo
)
<
0
)
return
-
1
;
if
(
tsdbUnRefMemTable
(
pRepo
,
pIMem
)
<
0
)
return
-
1
;
return
0
;
return
0
;
}
}
...
@@ -606,19 +605,13 @@ static int tsdbInsertDataToTable(STsdbRepo *pRepo, SSubmitBlk *pBlock, int32_t *
...
@@ -606,19 +605,13 @@ static int tsdbInsertDataToTable(STsdbRepo *pRepo, SSubmitBlk *pBlock, int32_t *
STable
*
pTable
=
NULL
;
STable
*
pTable
=
NULL
;
SSubmitBlkIter
blkIter
=
{
0
};
SSubmitBlkIter
blkIter
=
{
0
};
SDataRow
row
=
NULL
;
SDataRow
row
=
NULL
;
void
*
*
rows
=
NULL
;
void
*
rows
[
TSDB_MAX_INSERT_BATCH
]
=
{
0
}
;
int
rowCounter
=
0
;
int
rowCounter
=
0
;
ASSERT
(
pBlock
->
tid
<
pMeta
->
maxTables
);
ASSERT
(
pBlock
->
tid
<
pMeta
->
maxTables
);
pTable
=
pMeta
->
tables
[
pBlock
->
tid
];
pTable
=
pMeta
->
tables
[
pBlock
->
tid
];
ASSERT
(
pTable
!=
NULL
&&
TABLE_UID
(
pTable
)
==
pBlock
->
uid
);
ASSERT
(
pTable
!=
NULL
&&
TABLE_UID
(
pTable
)
==
pBlock
->
uid
);
rows
=
(
void
**
)
calloc
(
pBlock
->
numOfRows
,
sizeof
(
void
*
));
if
(
rows
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
return
-
1
;
}
tsdbInitSubmitBlkIter
(
pBlock
,
&
blkIter
);
tsdbInitSubmitBlkIter
(
pBlock
,
&
blkIter
);
while
((
row
=
tsdbGetSubmitBlkNext
(
&
blkIter
))
!=
NULL
)
{
while
((
row
=
tsdbGetSubmitBlkNext
(
&
blkIter
))
!=
NULL
)
{
if
(
tsdbCopyRowToMem
(
pRepo
,
row
,
pTable
,
&
(
rows
[
rowCounter
]))
<
0
)
{
if
(
tsdbCopyRowToMem
(
pRepo
,
row
,
pTable
,
&
(
rows
[
rowCounter
]))
<
0
)
{
...
@@ -632,9 +625,18 @@ static int tsdbInsertDataToTable(STsdbRepo *pRepo, SSubmitBlk *pBlock, int32_t *
...
@@ -632,9 +625,18 @@ static int tsdbInsertDataToTable(STsdbRepo *pRepo, SSubmitBlk *pBlock, int32_t *
if
(
rows
[
rowCounter
]
!=
NULL
)
{
if
(
rows
[
rowCounter
]
!=
NULL
)
{
rowCounter
++
;
rowCounter
++
;
}
}
if
(
rowCounter
==
TSDB_MAX_INSERT_BATCH
)
{
if
(
tsdbInsertDataToTableImpl
(
pRepo
,
pTable
,
rows
,
rowCounter
)
<
0
)
{
goto
_err
;
}
rowCounter
=
0
;
memset
(
rows
,
0
,
sizeof
(
rows
));
}
}
}
if
(
tsdbInsertDataToTableImpl
(
pRepo
,
pTable
,
rows
,
rowCounter
)
<
0
)
{
if
(
rowCounter
>
0
&&
tsdbInsertDataToTableImpl
(
pRepo
,
pTable
,
rows
,
rowCounter
)
<
0
)
{
goto
_err
;
goto
_err
;
}
}
...
@@ -642,11 +644,9 @@ static int tsdbInsertDataToTable(STsdbRepo *pRepo, SSubmitBlk *pBlock, int32_t *
...
@@ -642,11 +644,9 @@ static int tsdbInsertDataToTable(STsdbRepo *pRepo, SSubmitBlk *pBlock, int32_t *
pRepo
->
stat
.
pointsWritten
+=
points
*
schemaNCols
(
pSchema
);
pRepo
->
stat
.
pointsWritten
+=
points
*
schemaNCols
(
pSchema
);
pRepo
->
stat
.
totalStorage
+=
points
*
schemaVLen
(
pSchema
);
pRepo
->
stat
.
totalStorage
+=
points
*
schemaVLen
(
pSchema
);
free
(
rows
);
return
0
;
return
0
;
_err:
_err:
free
(
rows
);
return
-
1
;
return
-
1
;
}
}
...
...
tests/pytest/crash_gen/crash_gen_main.py
浏览文件 @
24f106c6
...
@@ -2224,22 +2224,25 @@ class ClientManager:
...
@@ -2224,22 +2224,25 @@ class ClientManager:
if
svcMgr
:
# gConfig.auto_start_service:
if
svcMgr
:
# gConfig.auto_start_service:
svcMgr
.
stopTaosServices
()
svcMgr
.
stopTaosServices
()
svcMgr
=
None
svcMgr
=
None
# Print exec status, etc., AFTER showing messages from the server
self
.
conclude
()
# print("TC failed (2) = {}".format(self.tc.isFailed()))
# Linux return code: ref https://shapeshed.com/unix-exit-codes/
ret
=
1
if
self
.
tc
.
isFailed
()
else
0
self
.
tc
.
cleanup
()
# Release global variables
# Release global variables
gConfig
=
None
gConfig
=
None
gSvcMgr
=
None
gSvcMgr
=
None
logger
=
None
logger
=
None
thPool
=
None
dbManager
.
cleanUp
()
# destructor wouldn't run in time
dbManager
=
None
# Print exec status, etc., AFTER showing messages from the server
self
.
conclude
()
# print("TC failed (2) = {}".format(self.tc.isFailed()))
# Linux return code: ref https://shapeshed.com/unix-exit-codes/
ret
=
1
if
self
.
tc
.
isFailed
()
else
0
self
.
tc
.
cleanup
()
# Release variables here
# Release variables here
self
.
tc
=
None
self
.
tc
=
None
thPool
=
None
dbManager
=
None
gc
.
collect
()
# force garbage collection
gc
.
collect
()
# force garbage collection
# h = hpy()
# h = hpy()
...
...
tests/pytest/crash_gen/db.py
浏览文件 @
24f106c6
...
@@ -394,6 +394,7 @@ class DbManager():
...
@@ -394,6 +394,7 @@ class DbManager():
cType
==
'native'
)
else
DbConn
.
createRest
(
dbTarget
)
cType
==
'native'
)
else
DbConn
.
createRest
(
dbTarget
)
try
:
try
:
self
.
_dbConn
.
open
()
# may throw taos.error.ProgrammingError: disconnected
self
.
_dbConn
.
open
()
# may throw taos.error.ProgrammingError: disconnected
Logging
.
debug
(
"DbManager opened DB connection..."
)
except
taos
.
error
.
ProgrammingError
as
err
:
except
taos
.
error
.
ProgrammingError
as
err
:
# print("Error type: {}, msg: {}, value: {}".format(type(err), err.msg, err))
# print("Error type: {}, msg: {}, value: {}".format(type(err), err.msg, err))
if
(
err
.
msg
==
'client disconnected'
):
# cannot open DB connection
if
(
err
.
msg
==
'client disconnected'
):
# cannot open DB connection
...
@@ -412,6 +413,10 @@ class DbManager():
...
@@ -412,6 +413,10 @@ class DbManager():
# Moved to Database()
# Moved to Database()
# self._stateMachine = StateMechine(self._dbConn)
# self._stateMachine = StateMechine(self._dbConn)
def
__del__
(
self
):
''' Release the underlying DB connection upon deletion of DbManager '''
self
.
cleanUp
()
def
getDbConn
(
self
):
def
getDbConn
(
self
):
return
self
.
_dbConn
return
self
.
_dbConn
...
@@ -438,5 +443,8 @@ class DbManager():
...
@@ -438,5 +443,8 @@ class DbManager():
return
"table_{}"
.
format
(
tblNum
)
return
"table_{}"
.
format
(
tblNum
)
def
cleanUp
(
self
):
def
cleanUp
(
self
):
self
.
_dbConn
.
close
()
if
self
.
_dbConn
:
self
.
_dbConn
.
close
()
self
.
_dbConn
=
None
Logging
.
debug
(
"DbManager closed DB connection..."
)
tests/pytest/crash_gen/misc.py
浏览文件 @
24f106c6
...
@@ -2,6 +2,7 @@ import threading
...
@@ -2,6 +2,7 @@ import threading
import
random
import
random
import
logging
import
logging
import
os
import
os
import
sys
import
taos
import
taos
...
@@ -53,7 +54,7 @@ class Logging:
...
@@ -53,7 +54,7 @@ class Logging:
# global misc.logger
# global misc.logger
_logger
=
logging
.
getLogger
(
'CrashGen'
)
# real logger
_logger
=
logging
.
getLogger
(
'CrashGen'
)
# real logger
_logger
.
addFilter
(
LoggingFilter
())
_logger
.
addFilter
(
LoggingFilter
())
ch
=
logging
.
StreamHandler
(
)
ch
=
logging
.
StreamHandler
(
sys
.
stdout
)
# Ref: https://stackoverflow.com/questions/14058453/making-python-loggers-output-all-messages-to-stdout-in-addition-to-log-file
_logger
.
addHandler
(
ch
)
_logger
.
addHandler
(
ch
)
# Logging adapter, to be used as a logger
# Logging adapter, to be used as a logger
...
...
tests/pytest/crash_gen_bootstrap.py
浏览文件 @
24f106c6
...
@@ -19,5 +19,5 @@ if __name__ == "__main__":
...
@@ -19,5 +19,5 @@ if __name__ == "__main__":
mExec
.
init
()
mExec
.
init
()
exitCode
=
mExec
.
run
()
exitCode
=
mExec
.
run
()
print
(
"
Exiting with
code: {}"
.
format
(
exitCode
))
print
(
"
\n
Crash_Gen is now exiting with status
code: {}"
.
format
(
exitCode
))
sys
.
exit
(
exitCode
)
sys
.
exit
(
exitCode
)
tests/pytest/import_merge/importCacheFileH.py
浏览文件 @
24f106c6
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importCacheFileHO.py
浏览文件 @
24f106c6
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importCacheFileHPO.py
浏览文件 @
24f106c6
...
@@ -57,7 +57,7 @@ class TDTestCase:
...
@@ -57,7 +57,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importCacheFileS.py
浏览文件 @
24f106c6
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importCacheFileSub.py
浏览文件 @
24f106c6
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importCacheFileT.py
浏览文件 @
24f106c6
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importCacheFileTO.py
浏览文件 @
24f106c6
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importCacheFileTPO.py
浏览文件 @
24f106c6
...
@@ -57,7 +57,7 @@ class TDTestCase:
...
@@ -57,7 +57,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataH2.py
浏览文件 @
24f106c6
...
@@ -59,7 +59,7 @@ class TDTestCase:
...
@@ -59,7 +59,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataHO.py
浏览文件 @
24f106c6
...
@@ -60,7 +60,7 @@ class TDTestCase:
...
@@ -60,7 +60,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataHO2.py
浏览文件 @
24f106c6
...
@@ -60,7 +60,7 @@ class TDTestCase:
...
@@ -60,7 +60,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataHPO.py
浏览文件 @
24f106c6
...
@@ -62,7 +62,7 @@ class TDTestCase:
...
@@ -62,7 +62,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataLastH.py
浏览文件 @
24f106c6
...
@@ -59,7 +59,7 @@ class TDTestCase:
...
@@ -59,7 +59,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataLastHO.py
浏览文件 @
24f106c6
...
@@ -59,7 +59,7 @@ class TDTestCase:
...
@@ -59,7 +59,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataLastHPO.py
浏览文件 @
24f106c6
...
@@ -61,7 +61,7 @@ class TDTestCase:
...
@@ -61,7 +61,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataLastS.py
浏览文件 @
24f106c6
...
@@ -59,7 +59,7 @@ class TDTestCase:
...
@@ -59,7 +59,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataLastSub.py
浏览文件 @
24f106c6
...
@@ -32,7 +32,7 @@ class TDTestCase:
...
@@ -32,7 +32,7 @@ class TDTestCase:
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'drop database if exists db'
)
...
@@ -60,9 +60,9 @@ class TDTestCase:
...
@@ -60,9 +60,9 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 10 data totally repetitive"
)
tdLog
.
info
(
"import 10 data totally repetitive"
)
...
...
tests/pytest/import_merge/importDataLastT.py
浏览文件 @
24f106c6
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataLastTO.py
浏览文件 @
24f106c6
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataLastTPO.py
浏览文件 @
24f106c6
...
@@ -57,7 +57,7 @@ class TDTestCase:
...
@@ -57,7 +57,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataS.py
浏览文件 @
24f106c6
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataSub.py
浏览文件 @
24f106c6
...
@@ -60,7 +60,7 @@ class TDTestCase:
...
@@ -60,7 +60,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataT.py
浏览文件 @
24f106c6
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataTO.py
浏览文件 @
24f106c6
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataTPO.py
浏览文件 @
24f106c6
...
@@ -57,9 +57,9 @@ class TDTestCase:
...
@@ -57,9 +57,9 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 20 data later with partly overlap"
)
tdLog
.
info
(
"import 20 data later with partly overlap"
)
...
...
tests/pytest/import_merge/importHORestart.py
浏览文件 @
24f106c6
...
@@ -57,7 +57,7 @@ class TDTestCase:
...
@@ -57,7 +57,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
query
(
'select * from tb1'
)
...
...
tests/pytest/import_merge/importHPORestart.py
浏览文件 @
24f106c6
...
@@ -62,7 +62,7 @@ class TDTestCase:
...
@@ -62,7 +62,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
query
(
'select * from tb1'
)
...
...
tests/pytest/import_merge/importHRestart.py
浏览文件 @
24f106c6
...
@@ -54,7 +54,7 @@ class TDTestCase:
...
@@ -54,7 +54,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
query
(
'select * from tb1'
)
...
...
tests/pytest/import_merge/importInsertThenImport.py
浏览文件 @
24f106c6
...
@@ -61,7 +61,7 @@ class TDTestCase:
...
@@ -61,7 +61,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"import 100 sequential data again"
)
tdLog
.
info
(
"import 100 sequential data again"
)
...
...
tests/pytest/import_merge/importLastH.py
浏览文件 @
24f106c6
...
@@ -53,7 +53,7 @@ class TDTestCase:
...
@@ -53,7 +53,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importLastHO.py
浏览文件 @
24f106c6
...
@@ -53,7 +53,7 @@ class TDTestCase:
...
@@ -53,7 +53,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importLastHPO.py
浏览文件 @
24f106c6
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importLastS.py
浏览文件 @
24f106c6
...
@@ -53,7 +53,7 @@ class TDTestCase:
...
@@ -53,7 +53,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importLastSub.py
浏览文件 @
24f106c6
...
@@ -53,7 +53,7 @@ class TDTestCase:
...
@@ -53,7 +53,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importLastT.py
浏览文件 @
24f106c6
...
@@ -57,7 +57,7 @@ class TDTestCase:
...
@@ -57,7 +57,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importLastTO.py
浏览文件 @
24f106c6
...
@@ -57,7 +57,7 @@ class TDTestCase:
...
@@ -57,7 +57,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importLastTPO.py
浏览文件 @
24f106c6
...
@@ -59,7 +59,7 @@ class TDTestCase:
...
@@ -59,7 +59,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importSRestart.py
浏览文件 @
24f106c6
...
@@ -64,7 +64,7 @@ class TDTestCase:
...
@@ -64,7 +64,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
query
(
'select * from tb1'
)
...
...
tests/pytest/import_merge/importSubRestart.py
浏览文件 @
24f106c6
...
@@ -64,7 +64,7 @@ class TDTestCase:
...
@@ -64,7 +64,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
query
(
'select * from tb1'
)
...
...
tests/pytest/import_merge/importTORestart.py
浏览文件 @
24f106c6
...
@@ -64,7 +64,7 @@ class TDTestCase:
...
@@ -64,7 +64,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
query
(
'select * from tb1'
)
...
...
tests/pytest/import_merge/importTPORestart.py
浏览文件 @
24f106c6
...
@@ -68,7 +68,7 @@ class TDTestCase:
...
@@ -68,7 +68,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
query
(
'select * from tb1'
)
...
...
tests/pytest/import_merge/importTRestart.py
浏览文件 @
24f106c6
...
@@ -61,7 +61,7 @@ class TDTestCase:
...
@@ -61,7 +61,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
query
(
'select * from tb1'
)
...
...
tests/pytest/query/query.py
浏览文件 @
24f106c6
...
@@ -16,7 +16,7 @@ import taos
...
@@ -16,7 +16,7 @@ import taos
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
from
util.dnodes
import
tdDnodes
class
TDTestCase
:
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
...
@@ -44,6 +44,25 @@ class TDTestCase:
...
@@ -44,6 +44,25 @@ class TDTestCase:
tdSql
.
query
(
"select * from db.st where ts='2020-05-13 10:00:00.000'"
)
tdSql
.
query
(
"select * from db.st where ts='2020-05-13 10:00:00.000'"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkRows
(
1
)
## test case for https://jira.taosdata.com:18080/browse/TD-2488
tdSql
.
execute
(
"create table m1(ts timestamp, k int) tags(a int)"
)
tdSql
.
execute
(
"create table t1 using m1 tags(1)"
)
tdSql
.
execute
(
"create table t2 using m1 tags(2)"
)
tdSql
.
execute
(
"insert into t1 values('2020-1-1 1:1:1', 1)"
)
tdSql
.
execute
(
"insert into t1 values('2020-1-1 1:10:1', 2)"
)
tdSql
.
execute
(
"insert into t2 values('2020-1-1 1:5:1', 99)"
)
tdSql
.
query
(
"select count(*) from m1 where ts = '2020-1-1 1:5:1' "
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
query
(
"select count(*) from m1 where ts = '2020-1-1 1:5:1' "
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录