提交 1bd9c533 编写于 作者: haoranc's avatar haoranc

test: modify testcase on windows

上级 edd4a787
...@@ -224,13 +224,13 @@ class TDTestCase: ...@@ -224,13 +224,13 @@ class TDTestCase:
sql = f"select timediff(ts - {val}b, ts1) from st " sql = f"select timediff(ts - {val}b, ts1) from st "
self.checkExpect(sql, val) self.checkExpect(sql, val)
# init # # init
def init(self, conn, logSql, replicaVar=1): # def init(self, conn, logSql, replicaVar=1):
seed = time.clock_gettime(time.CLOCK_REALTIME) # seed = time.clock_gettime(time.CLOCK_REALTIME)
random.seed(seed) # random.seed(seed)
self.replicaVar = int(replicaVar) # self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") # tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), True) # tdSql.init(conn.cursor(), True)
# where # where
def checkWhere(self): def checkWhere(self):
......
...@@ -93,19 +93,20 @@ class TDTestCase: ...@@ -93,19 +93,20 @@ class TDTestCase:
cfgPath = tdCom.getClientCfgPath() cfgPath = tdCom.getClientCfgPath()
taosLogFile = '%s/../log/taoslog*'%(cfgPath) taosLogFile = '%s/../log/taoslog*'%(cfgPath)
filterResultFile = '%s/../log/filter'%(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) tdLog.info(cmdStr)
os.system(cmdStr) os.system(cmdStr)
consumerDict = {} consumerDict = {}
for index, line in enumerate(open(filterResultFile,'r')): for index, line in enumerate(open(filterResultFile,'r')):
# tdLog.info("row[%d]: %s"%(index, line)) # tdLog.info("row[%d]: %s"%(index, line))
valueList = line.split(',') valueList = line.split(',')
# for i in range(len(valueList)): # for i in range(len(valueList)):
# tdLog.info("index[%d]: %s"%(i, valueList[i])) # tdLog.info("index[%d]: %s"%(i, valueList[i]))
# get consumer id # get consumer id
list2 = valueList[0].split(':') list2 = valueList[0].split(':')
list3 = list2[4].split() list3 = list2[3].split()
consumerId = list3[0] consumerId = list3[0]
print("consumerId: %s"%(consumerId)) print("consumerId: %s"%(consumerId))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册