提交 8dd2921c 编写于 作者: P plum-lihui

test: modify check mode

上级 4bf970a3
...@@ -37,6 +37,9 @@ from util.common import * ...@@ -37,6 +37,9 @@ from util.common import *
# INSERT_DATA = 3 # INSERT_DATA = 3
class TMQCom: class TMQCom:
def __init__(self):
self.g_end_insert_flag = 0
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdSql.init(conn.cursor()) tdSql.init(conn.cursor())
...@@ -330,8 +333,11 @@ class TMQCom: ...@@ -330,8 +333,11 @@ class TMQCom:
ctbDict[i] = 0 ctbDict[i] = 0
#tdLog.debug("doing insert data into stable:%s rows:%d ..."%(stbName, allRows)) #tdLog.debug("doing insert data into stable:%s rows:%d ..."%(stbName, allRows))
rowsOfCtb = 0 rowsOfCtb = 0
while rowsOfCtb < rowsPerTbl: while rowsOfCtb < rowsPerTbl:
if (0 != self.g_end_insert_flag):
tdLog.debug("get signal to stop insert data")
break
for i in range(ctbNum): for i in range(ctbNum):
sql += " %s.%s%d values "%(dbName,ctbPrefix,i+ctbStartIdx) sql += " %s.%s%d values "%(dbName,ctbPrefix,i+ctbStartIdx)
rowsBatched = 0 rowsBatched = 0
......
...@@ -13,7 +13,7 @@ from tmqCommon import * ...@@ -13,7 +13,7 @@ from tmqCommon import *
class TDTestCase: class TDTestCase:
updatecfgDict = {'debugFlag': 135} updatecfgDict = {'debugFlag': 135}
def __init__(self): def __init__(self):
self.vgroups = 1 self.vgroups = 1
self.ctbNum = 10 self.ctbNum = 10
...@@ -145,7 +145,7 @@ class TDTestCase: ...@@ -145,7 +145,7 @@ class TDTestCase:
'ctbPrefix': 'ctb', 'ctbPrefix': 'ctb',
'ctbStartIdx': 0, 'ctbStartIdx': 0,
'ctbNum': 10, 'ctbNum': 10,
'rowsPerTbl': 1000, 'rowsPerTbl': 100000000,
'batchNum': 10, 'batchNum': 10,
'startTs': 1640966400000, # 2022-01-01 00:00:00.000 'startTs': 1640966400000, # 2022-01-01 00:00:00.000
'pollDelay': 3, 'pollDelay': 3,
...@@ -221,9 +221,10 @@ class TDTestCase: ...@@ -221,9 +221,10 @@ class TDTestCase:
if res != 'success': if res != 'success':
tdLog.exit("limit max groupid fail") tdLog.exit("limit max groupid fail")
tmqCom.g_end_insert_flag = 1
tdLog.debug("notify sub-thread to stop insert data")
pThread.join() pThread.join()
tdLog.info(" wait insert thread end")
tdLog.printNoPrefix("======== test case 1 end ...... ") tdLog.printNoPrefix("======== test case 1 end ...... ")
def run(self): def run(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册