Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
fc489882
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
fc489882
编写于
6月 11, 2022
作者:
wafwerar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(os): add win32 tmq case test
上级
0b36b14a
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
148 addition
and
84 deletion
+148
-84
source/os/src/osSemaphore.c
source/os/src/osSemaphore.c
+16
-16
tests/pytest/util/dnodes.py
tests/pytest/util/dnodes.py
+8
-2
tests/system-test/7-tmq/basic5.py
tests/system-test/7-tmq/basic5.py
+13
-8
tests/system-test/7-tmq/db.py
tests/system-test/7-tmq/db.py
+8
-4
tests/system-test/7-tmq/subscribeDb.py
tests/system-test/7-tmq/subscribeDb.py
+8
-4
tests/system-test/7-tmq/subscribeDb0.py
tests/system-test/7-tmq/subscribeDb0.py
+8
-4
tests/system-test/7-tmq/subscribeDb1.py
tests/system-test/7-tmq/subscribeDb1.py
+17
-7
tests/system-test/7-tmq/subscribeStb.py
tests/system-test/7-tmq/subscribeStb.py
+8
-4
tests/system-test/7-tmq/subscribeStb0.py
tests/system-test/7-tmq/subscribeStb0.py
+8
-4
tests/system-test/7-tmq/subscribeStb1.py
tests/system-test/7-tmq/subscribeStb1.py
+8
-4
tests/system-test/7-tmq/subscribeStb2.py
tests/system-test/7-tmq/subscribeStb2.py
+8
-4
tests/system-test/7-tmq/subscribeStb3.py
tests/system-test/7-tmq/subscribeStb3.py
+8
-4
tests/system-test/7-tmq/subscribeStb4.py
tests/system-test/7-tmq/subscribeStb4.py
+8
-4
tests/system-test/fulltest.bat
tests/system-test/fulltest.bat
+11
-11
tests/system-test/test-all.bat
tests/system-test/test-all.bat
+3
-3
tests/test/c/tmqSim.c
tests/test/c/tmqSim.c
+8
-1
未找到文件。
source/os/src/osSemaphore.c
浏览文件 @
fc489882
...
...
@@ -81,24 +81,24 @@ int32_t tsem_timewait(tsem_t* sem, int64_t nanosecs) {
rel
.
tv_nsec
=
nanosecs
;
GetSystemTimeAsFileTime
(
&
ft_before
);
errno
=
0
;
rc
=
sem_timedwait
(
&
sem
,
pthread_win32_getabstime_np
(
&
ts
,
&
rel
));
//
errno = 0;
rc
=
sem_timedwait
(
sem
,
pthread_win32_getabstime_np
(
&
ts
,
&
rel
));
/* This should have timed out */
assert
(
errno
==
ETIMEDOUT
);
assert
(
rc
!=
0
);
GetSystemTimeAsFileTime
(
&
ft_after
);
// We specified a non-zero wait. Time must advance.
if
(
ft_before
.
dwLowDateTime
==
ft_after
.
dwLowDateTime
&&
ft_before
.
dwHighDateTime
==
ft_after
.
dwHighDateTime
)
{
printf
(
"nanoseconds: %d, rc: %d, errno: %d. before filetime: %d, %d; after filetime: %d, %d
\n
"
,
nanosecs
,
rc
,
errno
,
(
int
)
ft_before
.
dwLowDateTime
,
(
int
)
ft_before
.
dwHighDateTime
,
(
int
)
ft_after
.
dwLowDateTime
,
(
int
)
ft_after
.
dwHighDateTime
);
printf
(
"time must advance during sem_timedwait."
);
return
1
;
}
return
0
;
//
assert(errno == ETIMEDOUT);
//
assert(rc != 0);
//
GetSystemTimeAsFileTime(&ft_after);
//
//
We specified a non-zero wait. Time must advance.
//
if (ft_before.dwLowDateTime == ft_after.dwLowDateTime && ft_before.dwHighDateTime == ft_after.dwHighDateTime)
//
{
//
printf("nanoseconds: %d, rc: %d, errno: %d. before filetime: %d, %d; after filetime: %d, %d\n",
//
nanosecs, rc, errno,
//
(int)ft_before.dwLowDateTime, (int)ft_before.dwHighDateTime,
//
(int)ft_after.dwLowDateTime, (int)ft_after.dwHighDateTime);
//
printf("time must advance during sem_timedwait.");
//
return 1;
//
}
return
rc
;
}
#elif defined(_TD_DARWIN_64)
...
...
tests/pytest/util/dnodes.py
浏览文件 @
fc489882
...
...
@@ -589,7 +589,10 @@ class TDDnodes:
psCmd
=
"ps -ef|grep -w taosd| grep -v grep| grep -v defunct | awk '{print $2}'"
processID
=
subprocess
.
check_output
(
psCmd
,
shell
=
True
).
decode
(
"utf-8"
)
while
(
processID
):
killCmd
=
"kill -9 %s > /dev/null 2>&1"
%
processID
if
platform
.
system
().
lower
()
==
'windows'
:
killCmd
=
"kill -9 %s > nul 2>&1"
%
processID
else
:
killCmd
=
"kill -9 %s > /dev/null 2>&1"
%
processID
os
.
system
(
killCmd
)
time
.
sleep
(
1
)
processID
=
subprocess
.
check_output
(
...
...
@@ -599,7 +602,10 @@ class TDDnodes:
psCmd
=
"ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}'"
processID
=
subprocess
.
check_output
(
psCmd
,
shell
=
True
).
decode
(
"utf-8"
)
while
(
processID
):
killCmd
=
"kill -TERM %s > /dev/null 2>&1"
%
processID
if
platform
.
system
().
lower
()
==
'windows'
:
killCmd
=
"kill -TERM %s > nul 2>&1"
%
processID
else
:
killCmd
=
"kill -TERM %s > /dev/null 2>&1"
%
processID
os
.
system
(
killCmd
)
time
.
sleep
(
1
)
processID
=
subprocess
.
check_output
(
...
...
tests/system-test/7-tmq/basic5.py
浏览文件 @
fc489882
...
...
@@ -196,11 +196,13 @@ class TDTestCase:
showMsg
=
1
showRow
=
1
shellCmd
=
'nohup '
+
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
parameterDict
[
"dbName"
],
showMsg
,
showRow
,
cdbName
)
if
(
platform
.
system
().
lower
()
==
'windows'
):
shellCmd
=
'mintty -h never -w hide '
+
buildPath
+
'
\\
build
\\
bin
\\
tmq_sim.exe -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
parameterDict
[
"dbName"
],
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> nul 2>&1 &"
else
:
shellCmd
=
'nohup '
+
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
parameterDict
[
"dbName"
],
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
tdLog
.
info
(
shellCmd
)
os
.
system
(
shellCmd
)
...
...
@@ -312,12 +314,13 @@ class TDTestCase:
pollDelay
=
100
showMsg
=
1
showRow
=
1
shellCmd
=
'nohup '
+
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
parameterDict
[
"dbName"
],
showMsg
,
showRow
,
cdbName
)
if
(
platform
.
system
().
lower
()
==
'windows'
):
shellCmd
+=
"> nul 2>&1 &"
shellCmd
=
'mintty -h never -w hide '
+
buildPath
+
'
\\
build
\\
bin
\\
tmq_sim.exe -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
parameterDict
[
"dbName"
],
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> nul 2>&1 &"
else
:
shellCmd
=
'nohup '
+
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
parameterDict
[
"dbName"
],
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
tdLog
.
info
(
shellCmd
)
os
.
system
(
shellCmd
)
...
...
@@ -448,11 +451,13 @@ class TDTestCase:
showMsg
=
1
showRow
=
1
shellCmd
=
'nohup '
+
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
parameterDict
[
"dbName"
],
showMsg
,
showRow
,
cdbName
)
if
(
platform
.
system
().
lower
()
==
'windows'
):
shellCmd
=
'mintty -h never -w hide '
+
buildPath
+
'
\\
build
\\
bin
\\
tmq_sim.exe -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
parameterDict
[
"dbName"
],
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> nul 2>&1 &"
else
:
shellCmd
=
'nohup '
+
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
parameterDict
[
"dbName"
],
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
tdLog
.
info
(
shellCmd
)
os
.
system
(
shellCmd
)
...
...
tests/system-test/7-tmq/db.py
浏览文件 @
fc489882
...
...
@@ -98,15 +98,19 @@ class TDTestCase:
return
resultList
def
startTmqSimProcess
(
self
,
buildPath
,
cfgPath
,
pollDelay
,
dbName
,
showMsg
=
1
,
showRow
=
1
,
cdbName
=
'cdb'
,
valgrind
=
0
):
shellCmd
=
'nohup '
if
valgrind
==
1
:
logFile
=
cfgPath
+
'/../log/valgrind-tmq.log'
shellCmd
=
'nohup valgrind --log-file='
+
logFile
shellCmd
+=
'--tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all --num-callers=20 -v --workaround-gcc296-bugs=yes '
shellCmd
+=
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
if
(
platform
.
system
().
lower
()
==
'windows'
):
shellCmd
=
'mintty -h never -w hide '
+
buildPath
+
'
\\
build
\\
bin
\\
tmq_sim.exe -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> nul 2>&1 &"
else
:
shellCmd
=
'nohup '
+
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
tdLog
.
info
(
shellCmd
)
os
.
system
(
shellCmd
)
...
...
tests/system-test/7-tmq/subscribeDb.py
浏览文件 @
fc489882
...
...
@@ -81,15 +81,19 @@ class TDTestCase:
return
resultList
def
startTmqSimProcess
(
self
,
buildPath
,
cfgPath
,
pollDelay
,
dbName
,
showMsg
=
1
,
showRow
=
1
,
cdbName
=
'cdb'
,
valgrind
=
0
):
shellCmd
=
'nohup '
if
valgrind
==
1
:
logFile
=
cfgPath
+
'/../log/valgrind-tmq.log'
shellCmd
=
'nohup valgrind --log-file='
+
logFile
shellCmd
+=
'--tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all --num-callers=20 -v --workaround-gcc296-bugs=yes '
shellCmd
+=
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
if
(
platform
.
system
().
lower
()
==
'windows'
):
shellCmd
=
'mintty -h never -w hide '
+
buildPath
+
'
\\
build
\\
bin
\\
tmq_sim.exe -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> nul 2>&1 &"
else
:
shellCmd
=
'nohup '
+
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
tdLog
.
info
(
shellCmd
)
os
.
system
(
shellCmd
)
...
...
tests/system-test/7-tmq/subscribeDb0.py
浏览文件 @
fc489882
...
...
@@ -81,15 +81,19 @@ class TDTestCase:
return
resultList
def
startTmqSimProcess
(
self
,
buildPath
,
cfgPath
,
pollDelay
,
dbName
,
showMsg
=
1
,
showRow
=
1
,
cdbName
=
'cdb'
,
valgrind
=
0
):
shellCmd
=
'nohup '
if
valgrind
==
1
:
logFile
=
cfgPath
+
'/../log/valgrind-tmq.log'
shellCmd
=
'nohup valgrind --log-file='
+
logFile
shellCmd
+=
'--tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all --num-callers=20 -v --workaround-gcc296-bugs=yes '
shellCmd
+=
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
if
(
platform
.
system
().
lower
()
==
'windows'
):
shellCmd
=
'mintty -h never -w hide '
+
buildPath
+
'
\\
build
\\
bin
\\
tmq_sim.exe -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> nul 2>&1 &"
else
:
shellCmd
=
'nohup '
+
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
tdLog
.
info
(
shellCmd
)
os
.
system
(
shellCmd
)
...
...
tests/system-test/7-tmq/subscribeDb1.py
浏览文件 @
fc489882
...
...
@@ -81,15 +81,19 @@ class TDTestCase:
return
resultList
def
startTmqSimProcess
(
self
,
buildPath
,
cfgPath
,
pollDelay
,
dbName
,
showMsg
=
1
,
showRow
=
1
,
cdbName
=
'cdb'
,
valgrind
=
0
):
shellCmd
=
'nohup '
if
valgrind
==
1
:
logFile
=
cfgPath
+
'/../log/valgrind-tmq.log'
shellCmd
=
'nohup valgrind --log-file='
+
logFile
shellCmd
+=
'--tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all --num-callers=20 -v --workaround-gcc296-bugs=yes '
shellCmd
+=
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
if
(
platform
.
system
().
lower
()
==
'windows'
):
shellCmd
=
'mintty -h never -w hide '
+
buildPath
+
'
\\
build
\\
bin
\\
tmq_sim.exe -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> nul 2>&1 &"
else
:
shellCmd
=
'nohup '
+
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
tdLog
.
info
(
shellCmd
)
os
.
system
(
shellCmd
)
...
...
@@ -361,7 +365,10 @@ class TDTestCase:
time
.
sleep
(
2
)
tdLog
.
info
(
"pkill consume processor"
)
os
.
system
(
'pkill tmq_sim'
)
if
(
platform
.
system
().
lower
()
==
'windows'
):
os
.
system
(
"TASKKILL /F /IM tmq_sim.exe"
)
else
:
os
.
system
(
'pkill tmq_sim'
)
expectRows
=
0
resultList
=
self
.
selectConsumeResult
(
expectRows
)
...
...
@@ -433,7 +440,10 @@ class TDTestCase:
time
.
sleep
(
5
)
tdLog
.
info
(
"pkill consume processor"
)
os
.
system
(
'pkill tmq_sim'
)
if
(
platform
.
system
().
lower
()
==
'windows'
):
os
.
system
(
"TASKKILL /F /IM tmq_sim.exe"
)
else
:
os
.
system
(
'pkill tmq_sim'
)
expectRows
=
0
resultList
=
self
.
selectConsumeResult
(
expectRows
)
...
...
tests/system-test/7-tmq/subscribeStb.py
浏览文件 @
fc489882
...
...
@@ -93,15 +93,19 @@ class TDTestCase:
return
resultList
def
startTmqSimProcess
(
self
,
buildPath
,
cfgPath
,
pollDelay
,
dbName
,
showMsg
=
1
,
showRow
=
1
,
cdbName
=
'cdb'
,
valgrind
=
0
):
shellCmd
=
'nohup '
if
valgrind
==
1
:
logFile
=
cfgPath
+
'/../log/valgrind-tmq.log'
shellCmd
=
'nohup valgrind --log-file='
+
logFile
shellCmd
+=
'--tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all --num-callers=20 -v --workaround-gcc296-bugs=yes '
shellCmd
+=
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
if
(
platform
.
system
().
lower
()
==
'windows'
):
shellCmd
=
'mintty -h never -w hide '
+
buildPath
+
'
\\
build
\\
bin
\\
tmq_sim.exe -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> nul 2>&1 &"
else
:
shellCmd
=
'nohup '
+
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
tdLog
.
info
(
shellCmd
)
os
.
system
(
shellCmd
)
...
...
tests/system-test/7-tmq/subscribeStb0.py
浏览文件 @
fc489882
...
...
@@ -93,15 +93,19 @@ class TDTestCase:
return
resultList
def
startTmqSimProcess
(
self
,
buildPath
,
cfgPath
,
pollDelay
,
dbName
,
showMsg
=
1
,
showRow
=
1
,
cdbName
=
'cdb'
,
valgrind
=
0
):
shellCmd
=
'nohup '
if
valgrind
==
1
:
logFile
=
cfgPath
+
'/../log/valgrind-tmq.log'
shellCmd
=
'nohup valgrind --log-file='
+
logFile
shellCmd
+=
'--tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all --num-callers=20 -v --workaround-gcc296-bugs=yes '
shellCmd
+=
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
if
(
platform
.
system
().
lower
()
==
'windows'
):
shellCmd
=
'mintty -h never -w hide '
+
buildPath
+
'
\\
build
\\
bin
\\
tmq_sim.exe -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> nul 2>&1 &"
else
:
shellCmd
=
'nohup '
+
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
tdLog
.
info
(
shellCmd
)
os
.
system
(
shellCmd
)
...
...
tests/system-test/7-tmq/subscribeStb1.py
浏览文件 @
fc489882
...
...
@@ -93,15 +93,19 @@ class TDTestCase:
return
resultList
def
startTmqSimProcess
(
self
,
buildPath
,
cfgPath
,
pollDelay
,
dbName
,
showMsg
=
1
,
showRow
=
1
,
cdbName
=
'cdb'
,
valgrind
=
0
):
shellCmd
=
'nohup '
if
valgrind
==
1
:
logFile
=
cfgPath
+
'/../log/valgrind-tmq.log'
shellCmd
=
'nohup valgrind --log-file='
+
logFile
shellCmd
+=
'--tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all --num-callers=20 -v --workaround-gcc296-bugs=yes '
shellCmd
+=
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
if
(
platform
.
system
().
lower
()
==
'windows'
):
shellCmd
=
'mintty -h never -w hide '
+
buildPath
+
'
\\
build
\\
bin
\\
tmq_sim.exe -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> nul 2>&1 &"
else
:
shellCmd
=
'nohup '
+
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
tdLog
.
info
(
shellCmd
)
os
.
system
(
shellCmd
)
...
...
tests/system-test/7-tmq/subscribeStb2.py
浏览文件 @
fc489882
...
...
@@ -93,15 +93,19 @@ class TDTestCase:
return
resultList
def
startTmqSimProcess
(
self
,
buildPath
,
cfgPath
,
pollDelay
,
dbName
,
showMsg
=
1
,
showRow
=
1
,
cdbName
=
'cdb'
,
valgrind
=
0
):
shellCmd
=
'nohup '
if
valgrind
==
1
:
logFile
=
cfgPath
+
'/../log/valgrind-tmq.log'
shellCmd
=
'nohup valgrind --log-file='
+
logFile
shellCmd
+=
'--tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all --num-callers=20 -v --workaround-gcc296-bugs=yes '
shellCmd
+=
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
if
(
platform
.
system
().
lower
()
==
'windows'
):
shellCmd
=
'mintty -h never -w hide '
+
buildPath
+
'
\\
build
\\
bin
\\
tmq_sim.exe -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> nul 2>&1 &"
else
:
shellCmd
=
'nohup '
+
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
tdLog
.
info
(
shellCmd
)
os
.
system
(
shellCmd
)
...
...
tests/system-test/7-tmq/subscribeStb3.py
浏览文件 @
fc489882
...
...
@@ -93,15 +93,19 @@ class TDTestCase:
return
resultList
def
startTmqSimProcess
(
self
,
buildPath
,
cfgPath
,
pollDelay
,
dbName
,
showMsg
=
1
,
showRow
=
1
,
cdbName
=
'cdb'
,
valgrind
=
0
):
shellCmd
=
'nohup '
if
valgrind
==
1
:
logFile
=
cfgPath
+
'/../log/valgrind-tmq.log'
shellCmd
=
'nohup valgrind --log-file='
+
logFile
shellCmd
+=
'--tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all --num-callers=20 -v --workaround-gcc296-bugs=yes '
shellCmd
+=
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
if
(
platform
.
system
().
lower
()
==
'windows'
):
shellCmd
=
'mintty -h never -w hide '
+
buildPath
+
'
\\
build
\\
bin
\\
tmq_sim.exe -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> nul 2>&1 &"
else
:
shellCmd
=
'nohup '
+
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
tdLog
.
info
(
shellCmd
)
os
.
system
(
shellCmd
)
...
...
tests/system-test/7-tmq/subscribeStb4.py
浏览文件 @
fc489882
...
...
@@ -93,15 +93,19 @@ class TDTestCase:
return
resultList
def
startTmqSimProcess
(
self
,
buildPath
,
cfgPath
,
pollDelay
,
dbName
,
showMsg
=
1
,
showRow
=
1
,
cdbName
=
'cdb'
,
valgrind
=
0
):
shellCmd
=
'nohup '
if
valgrind
==
1
:
logFile
=
cfgPath
+
'/../log/valgrind-tmq.log'
shellCmd
=
'nohup valgrind --log-file='
+
logFile
shellCmd
+=
'--tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all --num-callers=20 -v --workaround-gcc296-bugs=yes '
shellCmd
+=
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
if
(
platform
.
system
().
lower
()
==
'windows'
):
shellCmd
=
'mintty -h never -w hide '
+
buildPath
+
'
\\
build
\\
bin
\\
tmq_sim.exe -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> nul 2>&1 &"
else
:
shellCmd
=
'nohup '
+
buildPath
+
'/build/bin/tmq_sim -c '
+
cfgPath
shellCmd
+=
" -y %d -d %s -g %d -r %d -w %s "
%
(
pollDelay
,
dbName
,
showMsg
,
showRow
,
cdbName
)
shellCmd
+=
"> /dev/null 2>&1 &"
tdLog
.
info
(
shellCmd
)
os
.
system
(
shellCmd
)
...
...
tests/system-test/fulltest.bat
浏览文件 @
fc489882
...
...
@@ -89,14 +89,14 @@ python3 .\test.py -f 2-query\stateduration.py
python3
.\test.py
-f
2
-query
\function_stateduration.py
python3
.\test.py
-f
2
-query
\statecount.py
@REM python3 .\test.py -f 7-tmq\basic5.py
@REM python3 .\test.py -f 7-tmq\subscribeDb.py
@REM python3 .\test.py -f 7-tmq\subscribeDb0.py
@REM python3 .\test.py -f 7-tmq\subscribeDb1.py
@REM python3 .\test.py -f 7-tmq\subscribeStb.py
@REM python3 .\test.py -f 7-tmq\subscribeStb0.py
@REM python3 .\test.py -f 7-tmq\subscribeStb1.py
@REM python3 .\test.py -f 7-tmq\subscribeStb2.py
@REM python3 .\test.py -f 7-tmq\subscribeStb3.py
@REM python3 .\test.py -f 7-tmq\subscribeStb4.py
@REM python3 .\test.py -f 7-tmq\db.py
\ No newline at end of file
python3
.\test.py
-f
7
-tmq
\basic5.py
python3
.\test.py
-f
7
-tmq
\subscribeDb.py
python3
.\test.py
-f
7
-tmq
\subscribeDb0.py
python3
.\test.py
-f
7
-tmq
\subscribeDb1.py
python3
.\test.py
-f
7
-tmq
\subscribeStb.py
python3
.\test.py
-f
7
-tmq
\subscribeStb0.py
python3
.\test.py
-f
7
-tmq
\subscribeStb1.py
python3
.\test.py
-f
7
-tmq
\subscribeStb2.py
python3
.\test.py
-f
7
-tmq
\subscribeStb3.py
python3
.\test.py
-f
7
-tmq
\subscribeStb4.py
python3
.\test.py
-f
7
-tmq
\db.py
\ No newline at end of file
tests/system-test/test-all.bat
浏览文件 @
fc489882
...
...
@@ -62,14 +62,14 @@ set tt=%tt::= %
set
index
=
1
for
%%a
in
(
%tt%
)
do
(
if
!index!
EQU
1
(
set
hh
=
%%a
set
/a
hh
=
%%a
)
^
else
if
!index!
EQU
2
(
set
mm
=
%%a
set
/a
mm
=
%%a
)
^
else
if
!index!
EQU
3
(
set
ss
=
%%a
set
/a
ss
=
%%a
)
set
/a
index
=
index
+
1
)
...
...
tests/test/c/tmqSim.c
浏览文件 @
fc489882
...
...
@@ -128,7 +128,12 @@ void initLogFile() {
sprintf
(
filename
,
"%s/../log/tmqlog_%s.txt"
,
configDir
,
getCurrentTimeString
(
tmpString
));
//sprintf(filename, "%s/../log/tmqlog.txt", configDir);
#ifdef WINDOWS
for
(
int
i
=
2
;
i
<
sizeof
(
filename
);
i
++
)
{
if
(
filename
[
i
]
==
':'
)
filename
[
i
]
=
'-'
;
if
(
filename
[
i
]
==
'\0'
)
break
;
}
#endif
TdFilePtr
pFile
=
taosOpenFile
(
filename
,
TD_FILE_TEXT
|
TD_FILE_WRITE
|
TD_FILE_TRUNC
|
TD_FILE_STREAM
);
if
(
NULL
==
pFile
)
{
fprintf
(
stderr
,
"Failed to open %s for save result
\n
"
,
filename
);
...
...
@@ -629,7 +634,9 @@ int32_t getConsumeInfo() {
return
0
;
}
LONG
WINAPI
exceptionHandler
(
LPEXCEPTION_POINTERS
exception
);
int
main
(
int32_t
argc
,
char
*
argv
[])
{
SetUnhandledExceptionFilter
(
exceptionHandler
);
parseArgument
(
argc
,
argv
);
getConsumeInfo
();
saveConfigToLogFile
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录