enh: coverage of tlog.c

This commit is contained in:
kailixu 2024-12-25 11:21:55 +08:00
parent 9e6ace9e9d
commit 6872cd38c1
2 changed files with 5 additions and 1 deletions

View File

@ -508,7 +508,7 @@ pipeline {
} }
} }
stage('linux test') { stage('linux test') {
agent{label "slave1_47 || slave1_48 || slave1_49 || slave1_50 || slave1_52 || slave1_59 || slave1_63 || worker03 || slave215 || slave217 || slave219 "} agent{label "slave1_47 || slave1_48 || slave1_49 || slave1_50 || slave1_52 || slave1_59 || slave1_63"}
options { skipDefaultCheckout() } options { skipDefaultCheckout() }
when { when {
changeRequest() changeRequest()

View File

@ -98,11 +98,15 @@ TEST(log, misc) {
EXPECT_NE(pCrashMsg, nullptr); EXPECT_NE(pCrashMsg, nullptr);
tstrncpy(pCrashMsg, "crashMsg", 16); tstrncpy(pCrashMsg, "crashMsg", 16);
#if !defined(_TD_DARWIN_64) && !defined(WINDOWS)
pid_t pid = taosGetPId(); pid_t pid = taosGetPId();
EXPECT_EQ(pid > 0, true); EXPECT_EQ(pid > 0, true);
siginfo_t sigInfo = {0}; siginfo_t sigInfo = {0};
sigInfo.si_pid = pid; sigInfo.si_pid = pid;
taosLogCrashInfo(nodeType, pCrashMsg, strlen(pCrashMsg), 0, &sigInfo); taosLogCrashInfo(nodeType, pCrashMsg, strlen(pCrashMsg), 0, &sigInfo);
#else
taosLogCrashInfo(nodeType, pCrashMsg, strlen(pCrashMsg), 0, nullptr);
#endif
char crashInfo[PATH_MAX] = {0}; char crashInfo[PATH_MAX] = {0};
snprintf(crashInfo, sizeof(crashInfo), "%s%s.%sCrashLog", tsLogDir, TD_DIRSEP, nodeType); snprintf(crashInfo, sizeof(crashInfo), "%s%s.%sCrashLog", tsLogDir, TD_DIRSEP, nodeType);