fix: catalog ut and timer stop issue

This commit is contained in:
dapan1121 2024-12-26 09:52:36 +08:00
parent dcc2645691
commit 383a0b5dd5
2 changed files with 12 additions and 4 deletions

View File

@ -1986,10 +1986,17 @@ void catalogDestroy(void) {
} }
if (gCtgMgmt.cacheTimer) { if (gCtgMgmt.cacheTimer) {
if (taosTmrStop(gCtgMgmt.cacheTimer)) { if (!taosTmrStop(gCtgMgmt.cacheTimer)) {
qTrace("stop catalog cache timer may failed"); qDebug("catalog cacheTimer %" PRIuPTR " not stopped", (uintptr_t)gCtgMgmt.cacheTimer);
while (!taosTmrIsStopped(&gCtgMgmt.cacheTimer)) {
taosMsleep(1);
}
} }
qDebug("catalog cacheTimer %" PRIuPTR " is stopped", (uintptr_t)gCtgMgmt.cacheTimer);
gCtgMgmt.cacheTimer = NULL; gCtgMgmt.cacheTimer = NULL;
taosTmrCleanUp(gCtgMgmt.timer); taosTmrCleanUp(gCtgMgmt.timer);
gCtgMgmt.timer = NULL; gCtgMgmt.timer = NULL;
} }

View File

@ -149,12 +149,13 @@ void ctgTestInitLogFile() {
return; return;
} }
const char *defaultLogFileNamePrefix = "taoslog"; const char *defaultLogFileNamePrefix = "catalogTest";
const int32_t maxLogFileNum = 10; const int32_t maxLogFileNum = 10;
tsAsyncLog = 0; tsAsyncLog = 0;
qDebugFlag = 159; qDebugFlag = 159;
tmrDebugFlag = 159; tmrDebugFlag = 159;
tsNumOfLogLines = 1000000000;
TAOS_STRCPY(tsLogDir, TD_LOG_DIR_PATH); TAOS_STRCPY(tsLogDir, TD_LOG_DIR_PATH);
(void)ctgdEnableDebug("api", true); (void)ctgdEnableDebug("api", true);
@ -1839,7 +1840,7 @@ TEST(tableMeta, updateStbMeta) {
while (true) { while (true) {
uint64_t n = 0; uint64_t n = 0;
ASSERT(0 == ctgdGetStatNum("runtime.numOfOpDequeue", (void *)&n)); ASSERT(0 == ctgdGetStatNum("runtime.numOfOpDequeue", (void *)&n));
if (n != 3) { if (n < 3) {
taosMsleep(50); taosMsleep(50);
} else { } else {
break; break;