提交 64d3b4ae 编写于 作者: S Shengliang Guan

TD-2652 tsim may crash after the script is executed successfully

上级 7138b29f
......@@ -448,7 +448,6 @@ void simCloseNativeConnect(SScript *script) {
simDebug("script:%s, taos:%p closed", script->fileName, script->taos);
taos_close(script->taos);
taosMsleep(1200);
script->taos = NULL;
}
......
......@@ -40,14 +40,14 @@ int32_t main(int32_t argc, char *argv[]) {
printf("usage: %s [options] \n", argv[0]);
printf(" [-c config]: config directory, default is: %s\n", configDir);
printf(" [-f script]: script filename\n");
exit(0);
return 0;
}
}
if (!simSystemInit()) {
simError("failed to initialize the system");
simSystemCleanUp();
exit(1);
return -1;
}
simInfo("simulator is running ...");
......@@ -56,7 +56,7 @@ int32_t main(int32_t argc, char *argv[]) {
SScript *script = simParseScript(scriptFile);
if (script == NULL) {
simError("parse script file:%s failed", scriptFile);
exit(-1);
return -1;
}
simScriptList[++simScriptPos] = script;
......
......@@ -113,7 +113,7 @@ SScript *simProcessCallOver(SScript *script) {
if (script->killed) {
simInfo("script:" FAILED_PREFIX "%s" FAILED_POSTFIX ", " FAILED_PREFIX "failed" FAILED_POSTFIX ", error:%s",
script->fileName, script->error);
exit(-1);
return NULL;
} else {
simInfo("script:" SUCCESS_PREFIX "%s" SUCCESS_POSTFIX ", " SUCCESS_PREFIX "success" SUCCESS_POSTFIX,
script->fileName);
......@@ -125,7 +125,7 @@ SScript *simProcessCallOver(SScript *script) {
if (simScriptPos == -1) {
simInfo("----------------------------------------------------------------------");
simInfo("Simulation Test Done, " SUCCESS_PREFIX "%d" SUCCESS_POSTFIX " Passed:\n", simScriptSucced);
exit(0);
return NULL;
}
return simScriptList[simScriptPos];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册