From 75757fffb6731d2f3cccd02051be7b4e69a274ae Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Thu, 14 Dec 2023 17:19:16 +0800 Subject: [PATCH 1/2] enh: osSystemTest --- source/os/test/osSystemTests.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/source/os/test/osSystemTests.cpp b/source/os/test/osSystemTests.cpp index dfc92a1b72..86c600f135 100644 --- a/source/os/test/osSystemTests.cpp +++ b/source/os/test/osSystemTests.cpp @@ -38,4 +38,25 @@ TEST(osSystemTest, osSystem1) { #else taosLogTraceToBuf(tmp, sizeof(tmp), 8); #endif + double cpu_engine; + double cpu_system; + float cpu_cores; + int64_t mem_engine; // KB + int64_t mem_system; // KB + + taosGetCpuUsage(&cpu_system, &cpu_engine); + taosGetCpuCores(&cpu_cores, false); + + taosGetProcMemory(&mem_engine); + taosGetSysMemory(&mem_system); + printf("cpu_engine: %f cpu_system: %f\n", cpu_engine, cpu_system); + printf("cpu_cores: %f\n", cpu_cores); + ASSERT_GT(cpu_cores, 0); + ASSERT_GE(mem_engine, 0); + ASSERT_GE(mem_system, 0); + + float numOfCores = 0; + int32_t res = taosGetCpuInfo(tmp, 4096, &numOfCores); + printf("cpu info: %s\n", tmp); + ASSERT_EQ(res, 0); } From 662724bb4231fbaa02d9924d2a44d90ff518b065 Mon Sep 17 00:00:00 2001 From: factosea <285808407@qq.com> Date: Fri, 15 Dec 2023 17:38:04 +0800 Subject: [PATCH 2/2] enh: test case --- tests/system-test/1-insert/delete_stable.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/system-test/1-insert/delete_stable.py b/tests/system-test/1-insert/delete_stable.py index 67561c51e5..bff6548517 100644 --- a/tests/system-test/1-insert/delete_stable.py +++ b/tests/system-test/1-insert/delete_stable.py @@ -24,7 +24,7 @@ from util.common import * from util.sqlset import TDSetSql class TDTestCase: - updatecfgDict = {'tsdbdebugFlag': 143} + updatecfgDict = {'tsdbdebugFlag': 131} def init(self, conn, logSql, replicaVar=1): self.replicaVar = int(replicaVar) tdLog.debug("start to execute %s" % __file__) @@ -36,7 +36,7 @@ class TDTestCase: self.setsql = TDSetSql() self.stbname = 'stb' self.ntbname = 'ntb' - self.rowNum = 10 + self.rowNum = 3 self.tbnum = 3 self.ts = 1537146000000 self.binary_str = 'taosdata'