From 43afdc5ad0564693671c87910841baa8024fe4cd Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Tue, 14 Jun 2022 19:31:45 +0800 Subject: [PATCH 1/4] os: add taosd assert kill --- tests/system-test/7-tmq/basic5.py | 4 +++- tests/system-test/test-all.bat | 10 +++++----- tests/system-test/test.py | 15 +++++++++++---- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/tests/system-test/7-tmq/basic5.py b/tests/system-test/7-tmq/basic5.py index 3d9efea938..a10eaf1fb5 100644 --- a/tests/system-test/7-tmq/basic5.py +++ b/tests/system-test/7-tmq/basic5.py @@ -134,7 +134,7 @@ class TDTestCase: parameterDict['cfg'] = cfgPath prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict) prepareEnvThread.start() - time.sleep(2) + prepareEnvThread.join() # wait stb ready while 1: @@ -245,6 +245,7 @@ class TDTestCase: prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict) prepareEnvThread.start() + prepareEnvThread.join() # wait db ready while 1: @@ -371,6 +372,7 @@ class TDTestCase: prepareEnvThread = threading.Thread(target=self.prepareEnv, kwargs=parameterDict) prepareEnvThread.start() + prepareEnvThread.join() # wait db ready while 1: diff --git a/tests/system-test/test-all.bat b/tests/system-test/test-all.bat index 076be6563a..a5a114f6eb 100644 --- a/tests/system-test/test-all.bat +++ b/tests/system-test/test-all.bat @@ -61,19 +61,19 @@ goto :eof set tt=%1 set tt=%tt:.= % set tt=%tt::= % -set index=1 +set /a index=1 for %%a in (%tt%) do ( if !index! EQU 1 ( - set /a hh=%%a + set /a hh=%%a || echo 11 %%a )^ else if !index! EQU 2 ( - set /a mm=%%a + set /a mm=%%a || echo 22 %%a )^ else if !index! EQU 3 ( - set /a ss=%%a + set /a ss=%%a || echo 33 %%a ) set /a index=index+1 ) -set /a _timeTemp=(%hh%*60+%mm%)*60+%ss% || echo hh:%hh% mm:%mm% ss:%ss% +set /a _timeTemp=(%hh%*60+%mm%)*60+%ss% || echo 44 hh:%hh% mm:%mm% ss:%ss% goto :eof \ No newline at end of file diff --git a/tests/system-test/test.py b/tests/system-test/test.py index 47e0cefb52..aaa61d8127 100644 --- a/tests/system-test/test.py +++ b/tests/system-test/test.py @@ -21,6 +21,7 @@ import base64 import json import platform import socket +import threading from distutils.log import warn as printf from fabric2 import Connection sys.path.append("../pytest") @@ -30,6 +31,13 @@ from util.cases import * import taos +def checkRunTimeError(): + import win32gui + while 1: + time.sleep(1) + hwnd = win32gui.FindWindow(None, "Microsoft Visual C++ Runtime Library") + if hwnd: + os.system("TASKKILL /F /IM taosd.exe") if __name__ == "__main__": @@ -42,9 +50,6 @@ if __name__ == "__main__": logSql = True stop = 0 restart = False - windows = 0 - if platform.system().lower() == 'windows': - windows = 1 updateCfgDict = {} execCmd = "" opts, args = getopt.gnu_getopt(sys.argv[1:], 'f:p:m:l:scghrd:k:e:', [ @@ -159,7 +164,9 @@ if __name__ == "__main__": host = masterIp tdLog.info("Procedures for tdengine deployed in %s" % (host)) - if windows: + if platform.system().lower() == 'windows': + if (masterIp == ""): + threading.Thread(target=checkRunTimeError,daemon=True).start() tdCases.logSql(logSql) tdLog.info("Procedures for testing self-deployment") tdDnodes.init(deployPath, masterIp) From c7f276462547783b1ef9843aaf7c38be15657628 Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Tue, 14 Jun 2022 20:31:42 +0800 Subject: [PATCH 2/4] os: add taosd assert kill --- tests/system-test/test-all.bat | 9 +++++---- tests/system-test/test.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/system-test/test-all.bat b/tests/system-test/test-all.bat index a5a114f6eb..0929b1fc6e 100644 --- a/tests/system-test/test-all.bat +++ b/tests/system-test/test-all.bat @@ -61,19 +61,20 @@ goto :eof set tt=%1 set tt=%tt:.= % set tt=%tt::= % +set tt=%tt: 0= % set /a index=1 for %%a in (%tt%) do ( if !index! EQU 1 ( - set /a hh=%%a || echo 11 %%a + set /a hh=%%a )^ else if !index! EQU 2 ( - set /a mm=%%a || echo 22 %%a + set /a mm=%%a )^ else if !index! EQU 3 ( - set /a ss=%%a || echo 33 %%a + set /a ss=%%a ) set /a index=index+1 ) -set /a _timeTemp=(%hh%*60+%mm%)*60+%ss% || echo 44 hh:%hh% mm:%mm% ss:%ss% +set /a _timeTemp=(%hh%*60+%mm%)*60+%ss% goto :eof \ No newline at end of file diff --git a/tests/system-test/test.py b/tests/system-test/test.py index aaa61d8127..0022a51329 100644 --- a/tests/system-test/test.py +++ b/tests/system-test/test.py @@ -165,7 +165,7 @@ if __name__ == "__main__": tdLog.info("Procedures for tdengine deployed in %s" % (host)) if platform.system().lower() == 'windows': - if (masterIp == ""): + if (masterIp == "" and not fileName[0:3] == "udf"): threading.Thread(target=checkRunTimeError,daemon=True).start() tdCases.logSql(logSql) tdLog.info("Procedures for testing self-deployment") From 435aca2eeb0eb5a9c9a4b1ff2265d32226a8e281 Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Wed, 15 Jun 2022 09:04:06 +0800 Subject: [PATCH 3/4] os: add taosd assert kill --- tests/system-test/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/test.py b/tests/system-test/test.py index 0022a51329..5a68f548da 100644 --- a/tests/system-test/test.py +++ b/tests/system-test/test.py @@ -165,7 +165,7 @@ if __name__ == "__main__": tdLog.info("Procedures for tdengine deployed in %s" % (host)) if platform.system().lower() == 'windows': - if (masterIp == "" and not fileName[0:3] == "udf"): + if (masterIp == "" and not fileName[0:12] == "0-others\\udf"): threading.Thread(target=checkRunTimeError,daemon=True).start() tdCases.logSql(logSql) tdLog.info("Procedures for testing self-deployment") From 5f73b165f59bb0e40bdd31a84dd258a5dac59c35 Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Wed, 15 Jun 2022 15:59:56 +0800 Subject: [PATCH 4/4] os: add taosd assert kill --- source/libs/catalog/src/ctgCache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/catalog/src/ctgCache.c b/source/libs/catalog/src/ctgCache.c index 62890b8326..277516686b 100644 --- a/source/libs/catalog/src/ctgCache.c +++ b/source/libs/catalog/src/ctgCache.c @@ -1899,7 +1899,7 @@ _return: void ctgUpdateThreadUnexpectedStopped(void) { - if (CTG_IS_LOCKED(&gCtgMgmt.lock) > 0) CTG_UNLOCK(CTG_READ, &gCtgMgmt.lock); + if (!atomic_load_8((int8_t*)&gCtgMgmt.exit) && CTG_IS_LOCKED(&gCtgMgmt.lock) > 0) CTG_UNLOCK(CTG_READ, &gCtgMgmt.lock); } void ctgCleanupCacheQueue(void) {