From 1bd9c5337dca35818cd88101038816a4eb47d55c Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Tue, 15 Aug 2023 17:09:23 +0800 Subject: [PATCH] test: modify testcase on windows --- tests/system-test/1-insert/precisionNS.py | 14 +++++++------- tests/system-test/7-tmq/tmqClientConsLog.py | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/system-test/1-insert/precisionNS.py b/tests/system-test/1-insert/precisionNS.py index be8f1e21dc..674234b9b0 100644 --- a/tests/system-test/1-insert/precisionNS.py +++ b/tests/system-test/1-insert/precisionNS.py @@ -224,13 +224,13 @@ class TDTestCase: sql = f"select timediff(ts - {val}b, ts1) from st " self.checkExpect(sql, val) - # init - def init(self, conn, logSql, replicaVar=1): - seed = time.clock_gettime(time.CLOCK_REALTIME) - random.seed(seed) - self.replicaVar = int(replicaVar) - tdLog.debug(f"start to excute {__file__}") - tdSql.init(conn.cursor(), True) + # # init + # def init(self, conn, logSql, replicaVar=1): + # seed = time.clock_gettime(time.CLOCK_REALTIME) + # random.seed(seed) + # self.replicaVar = int(replicaVar) + # tdLog.debug(f"start to excute {__file__}") + # tdSql.init(conn.cursor(), True) # where def checkWhere(self): diff --git a/tests/system-test/7-tmq/tmqClientConsLog.py b/tests/system-test/7-tmq/tmqClientConsLog.py index 7f755726ce..d708e6642c 100644 --- a/tests/system-test/7-tmq/tmqClientConsLog.py +++ b/tests/system-test/7-tmq/tmqClientConsLog.py @@ -93,19 +93,20 @@ class TDTestCase: cfgPath = tdCom.getClientCfgPath() taosLogFile = '%s/../log/taoslog*'%(cfgPath) filterResultFile = '%s/../log/filter'%(cfgPath) - cmdStr = 'grep "process poll rsp, vgId:" %s >> %s'%(taosLogFile, filterResultFile) + cmdStr = 'grep -h "process poll rsp, vgId:" %s >> %s'%(taosLogFile, filterResultFile) tdLog.info(cmdStr) os.system(cmdStr) consumerDict = {} for index, line in enumerate(open(filterResultFile,'r')): + # tdLog.info("row[%d]: %s"%(index, line)) valueList = line.split(',') # for i in range(len(valueList)): # tdLog.info("index[%d]: %s"%(i, valueList[i])) # get consumer id list2 = valueList[0].split(':') - list3 = list2[4].split() + list3 = list2[3].split() consumerId = list3[0] print("consumerId: %s"%(consumerId)) -- GitLab