test: fix win test error
This commit is contained in:
parent
e0ec9687c5
commit
4849b0cb78
|
@ -79,10 +79,16 @@ ENDIF ()
|
||||||
|
|
||||||
option(
|
option(
|
||||||
BUILD_SANITIZER
|
BUILD_SANITIZER
|
||||||
"If build addr2line"
|
"If build sanitizer"
|
||||||
OFF
|
OFF
|
||||||
)
|
)
|
||||||
|
|
||||||
|
option(
|
||||||
|
TDENGINE_3
|
||||||
|
"TDengine 3.x"
|
||||||
|
ON
|
||||||
|
)
|
||||||
|
|
||||||
option(
|
option(
|
||||||
BUILD_ADDR2LINE
|
BUILD_ADDR2LINE
|
||||||
"If build addr2line"
|
"If build addr2line"
|
||||||
|
|
|
@ -22,7 +22,10 @@ extern "C" {
|
||||||
|
|
||||||
#if defined(_TD_DARWIN_64)
|
#if defined(_TD_DARWIN_64)
|
||||||
// specific
|
// specific
|
||||||
|
#ifndef __COMPAR_FN_T
|
||||||
|
#define __COMPAR_FN_T
|
||||||
typedef int(*__compar_fn_t)(const void *, const void *);
|
typedef int(*__compar_fn_t)(const void *, const void *);
|
||||||
|
#endif
|
||||||
|
|
||||||
// for send function in tsocket.c
|
// for send function in tsocket.c
|
||||||
#if defined(MSG_NOSIGNAL)
|
#if defined(MSG_NOSIGNAL)
|
||||||
|
@ -41,7 +44,10 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_ALPINE)
|
#if defined(_ALPINE)
|
||||||
|
#ifndef __COMPAR_FN_T
|
||||||
|
#define __COMPAR_FN_T
|
||||||
typedef int(*__compar_fn_t)(const void *, const void *);
|
typedef int(*__compar_fn_t)(const void *, const void *);
|
||||||
|
#endif
|
||||||
void error (int, int, const char *);
|
void error (int, int, const char *);
|
||||||
#ifndef PTHREAD_MUTEX_RECURSIVE_NP
|
#ifndef PTHREAD_MUTEX_RECURSIVE_NP
|
||||||
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
|
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
|
||||||
|
@ -54,7 +60,10 @@ extern "C" {
|
||||||
char *stpncpy (char *dest, const char *src, size_t n);
|
char *stpncpy (char *dest, const char *src, size_t n);
|
||||||
|
|
||||||
// specific
|
// specific
|
||||||
|
#ifndef __COMPAR_FN_T
|
||||||
|
#define __COMPAR_FN_T
|
||||||
typedef int (*__compar_fn_t)(const void *, const void *);
|
typedef int (*__compar_fn_t)(const void *, const void *);
|
||||||
|
#endif
|
||||||
#define ssize_t int
|
#define ssize_t int
|
||||||
#define _SSIZE_T_
|
#define _SSIZE_T_
|
||||||
#define bzero(ptr, size) memset((ptr), 0, (size))
|
#define bzero(ptr, size) memset((ptr), 0, (size))
|
||||||
|
@ -69,7 +78,6 @@ extern "C" {
|
||||||
char * strsep(char **stringp, const char *delim);
|
char * strsep(char **stringp, const char *delim);
|
||||||
char * getpass(const char *prefix);
|
char * getpass(const char *prefix);
|
||||||
char * strndup(const char *s, size_t n);
|
char * strndup(const char *s, size_t n);
|
||||||
int gettimeofday(struct timeval *ptv, void *pTimeZone);
|
|
||||||
|
|
||||||
// for send function in tsocket.c
|
// for send function in tsocket.c
|
||||||
#define MSG_NOSIGNAL 0
|
#define MSG_NOSIGNAL 0
|
||||||
|
|
|
@ -382,7 +382,7 @@ class TDDnode:
|
||||||
|
|
||||||
if self.valgrind == 0:
|
if self.valgrind == 0:
|
||||||
if platform.system().lower() == 'windows':
|
if platform.system().lower() == 'windows':
|
||||||
cmd = "mintty -h never -w hide %s -c %s" % (
|
cmd = "mintty -h never %s -c %s" % (
|
||||||
binPath, self.cfgDir)
|
binPath, self.cfgDir)
|
||||||
else:
|
else:
|
||||||
cmd = "nohup %s -c %s > /dev/null 2>&1 & " % (
|
cmd = "nohup %s -c %s > /dev/null 2>&1 & " % (
|
||||||
|
@ -391,7 +391,7 @@ class TDDnode:
|
||||||
valgrindCmdline = "valgrind --log-file=\"%s/../log/valgrind.log\" --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes"%self.cfgDir
|
valgrindCmdline = "valgrind --log-file=\"%s/../log/valgrind.log\" --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes"%self.cfgDir
|
||||||
|
|
||||||
if platform.system().lower() == 'windows':
|
if platform.system().lower() == 'windows':
|
||||||
cmd = "mintty -h never -w hide %s %s -c %s" % (
|
cmd = "mintty -h never %s %s -c %s" % (
|
||||||
valgrindCmdline, binPath, self.cfgDir)
|
valgrindCmdline, binPath, self.cfgDir)
|
||||||
else:
|
else:
|
||||||
cmd = "nohup %s %s -c %s 2>&1 & " % (
|
cmd = "nohup %s %s -c %s 2>&1 & " % (
|
||||||
|
@ -518,20 +518,20 @@ class TDDnode:
|
||||||
|
|
||||||
if self.running != 0:
|
if self.running != 0:
|
||||||
if platform.system().lower() == 'windows':
|
if platform.system().lower() == 'windows':
|
||||||
os.system("wmic process where \"name='taosd.exe' and CommandLine like '%%dnode%d%%'\" get processId | xargs echo | awk '{print $2}' | xargs taskkill -f -pid"%self.index)
|
psCmd = "for /f %a in ('wmic process where \"name='taosd.exe' and CommandLine like '%%dnode%d%%'\" get processId ^| xargs echo ^| awk ^'{print $2}^'') do @(ps | grep %a | awk '{print $1}' | xargs kill -INT )" % (self.index)
|
||||||
else:
|
else:
|
||||||
psCmd = "ps -ef|grep -w %s| grep dnode%d|grep -v grep | awk '{print $2}'" % (toBeKilled,self.index)
|
psCmd = "ps -ef|grep -w %s| grep dnode%d|grep -v grep | awk '{print $2}'" % (toBeKilled,self.index)
|
||||||
|
processID = subprocess.check_output(
|
||||||
|
psCmd, shell=True).decode("utf-8")
|
||||||
|
|
||||||
|
while(processID):
|
||||||
|
killCmd = "kill -INT %s > /dev/null 2>&1" % processID
|
||||||
|
os.system(killCmd)
|
||||||
|
time.sleep(1)
|
||||||
processID = subprocess.check_output(
|
processID = subprocess.check_output(
|
||||||
psCmd, shell=True).decode("utf-8")
|
psCmd, shell=True).decode("utf-8")
|
||||||
|
if self.valgrind:
|
||||||
while(processID):
|
time.sleep(2)
|
||||||
killCmd = "kill -INT %s > /dev/null 2>&1" % processID
|
|
||||||
os.system(killCmd)
|
|
||||||
time.sleep(1)
|
|
||||||
processID = subprocess.check_output(
|
|
||||||
psCmd, shell=True).decode("utf-8")
|
|
||||||
if self.valgrind:
|
|
||||||
time.sleep(2)
|
|
||||||
|
|
||||||
self.running = 0
|
self.running = 0
|
||||||
tdLog.debug("dnode:%d is stopped by kill -INT" % (self.index))
|
tdLog.debug("dnode:%d is stopped by kill -INT" % (self.index))
|
||||||
|
|
|
@ -77,7 +77,10 @@ goto :eof
|
||||||
:check_offline
|
:check_offline
|
||||||
sleep 1
|
sleep 1
|
||||||
for /f "tokens=2" %%C in ('wmic process where "name='taosd.exe' and CommandLine like '%%%NODE_NAME%%%'" get processId ^| xargs echo') do (
|
for /f "tokens=2" %%C in ('wmic process where "name='taosd.exe' and CommandLine like '%%%NODE_NAME%%%'" get processId ^| xargs echo') do (
|
||||||
echo check taosd offline
|
for /f "tokens=1" %%D in ('ps ^| grep %%C') do (
|
||||||
goto :check_offline
|
echo kill -INT %%D
|
||||||
|
echo check taosd offline %NODE_NAME% %%C %%D
|
||||||
|
goto :check_offline
|
||||||
|
)
|
||||||
)
|
)
|
||||||
goto :eof
|
goto :eof
|
|
@ -24,7 +24,7 @@ for /F "usebackq tokens=*" %%i in (!caseFile!) do (
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
exit !exitNum!
|
exit /b !exitNum!
|
||||||
|
|
||||||
:colorEcho
|
:colorEcho
|
||||||
set timeNow=%time%
|
set timeNow=%time%
|
||||||
|
|
|
@ -44,9 +44,10 @@ echo serverPort 7100 >> %TAOS_CFG%
|
||||||
echo logDir %LOG_DIR% >> %TAOS_CFG%
|
echo logDir %LOG_DIR% >> %TAOS_CFG%
|
||||||
echo scriptDir %SCRIPT_DIR% >> %TAOS_CFG%
|
echo scriptDir %SCRIPT_DIR% >> %TAOS_CFG%
|
||||||
echo numOfLogLines 100000000 >> %TAOS_CFG%
|
echo numOfLogLines 100000000 >> %TAOS_CFG%
|
||||||
echo rpcDebugFlag 135 >> %TAOS_CFG%
|
echo rpcDebugFlag 143 >> %TAOS_CFG%
|
||||||
echo tmrDebugFlag 131 >> %TAOS_CFG%
|
echo tmrDebugFlag 131 >> %TAOS_CFG%
|
||||||
echo cDebugFlag 135 >> %TAOS_CFG%
|
echo cDebugFlag 135 >> %TAOS_CFG%
|
||||||
|
echo qDebugFlag 143 >> %TAOS_CFG%
|
||||||
echo udebugFlag 135 >> %TAOS_CFG%
|
echo udebugFlag 135 >> %TAOS_CFG%
|
||||||
echo wal 0 >> %TAOS_CFG%
|
echo wal 0 >> %TAOS_CFG%
|
||||||
echo asyncLog 0 >> %TAOS_CFG%
|
echo asyncLog 0 >> %TAOS_CFG%
|
||||||
|
|
|
@ -37,12 +37,13 @@ def checkRunTimeError():
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
timeCount = timeCount + 1
|
timeCount = timeCount + 1
|
||||||
print("checkRunTimeError",timeCount)
|
print("checkRunTimeError",timeCount)
|
||||||
if (timeCount>900):
|
if (timeCount>600):
|
||||||
print("stop the test.")
|
print("stop the test.")
|
||||||
os.system("TASKKILL /F /IM taosd.exe")
|
os.system("TASKKILL /F /IM taosd.exe")
|
||||||
os.system("TASKKILL /F /IM taos.exe")
|
os.system("TASKKILL /F /IM taos.exe")
|
||||||
os.system("TASKKILL /F /IM tmq_sim.exe")
|
os.system("TASKKILL /F /IM tmq_sim.exe")
|
||||||
os.system("TASKKILL /F /IM mintty.exe")
|
os.system("TASKKILL /F /IM mintty.exe")
|
||||||
|
os.system("TASKKILL /F /IM python.exe")
|
||||||
quit(0)
|
quit(0)
|
||||||
hwnd = win32gui.FindWindow(None, "Microsoft Visual C++ Runtime Library")
|
hwnd = win32gui.FindWindow(None, "Microsoft Visual C++ Runtime Library")
|
||||||
if hwnd:
|
if hwnd:
|
||||||
|
@ -228,6 +229,22 @@ if __name__ == "__main__":
|
||||||
tdDnodes.deploy(1,updateCfgDict)
|
tdDnodes.deploy(1,updateCfgDict)
|
||||||
tdDnodes.start(1)
|
tdDnodes.start(1)
|
||||||
tdCases.logSql(logSql)
|
tdCases.logSql(logSql)
|
||||||
|
if queryPolicy != 1:
|
||||||
|
queryPolicy=int(queryPolicy)
|
||||||
|
conn = taos.connect(
|
||||||
|
host,
|
||||||
|
config=tdDnodes.getSimCfgPath())
|
||||||
|
tdSql.init(conn.cursor())
|
||||||
|
tdSql.execute("create qnode on dnode 1")
|
||||||
|
tdSql.execute('alter local "queryPolicy" "%d"'%queryPolicy)
|
||||||
|
tdSql.query("show local variables;")
|
||||||
|
for i in range(tdSql.queryRows):
|
||||||
|
if tdSql.queryResult[i][0] == "queryPolicy" :
|
||||||
|
if int(tdSql.queryResult[i][1]) == int(queryPolicy):
|
||||||
|
tdLog.success('alter queryPolicy to %d successfully'%queryPolicy)
|
||||||
|
else :
|
||||||
|
tdLog.debug(tdSql.queryResult)
|
||||||
|
tdLog.exit("alter queryPolicy to %d failed"%queryPolicy)
|
||||||
else :
|
else :
|
||||||
tdLog.debug("create an cluster with %s nodes and make %s dnode as independent mnode"%(dnodeNums,mnodeNums))
|
tdLog.debug("create an cluster with %s nodes and make %s dnode as independent mnode"%(dnodeNums,mnodeNums))
|
||||||
dnodeslist = cluster.configure_cluster(dnodeNums=dnodeNums,mnodeNums=mnodeNums)
|
dnodeslist = cluster.configure_cluster(dnodeNums=dnodeNums,mnodeNums=mnodeNums)
|
||||||
|
|
Loading…
Reference in New Issue