From 7af4b2c58437cac6bf4f98274767534ec7b3d862 Mon Sep 17 00:00:00 2001 From: plum-lihui Date: Thu, 27 Oct 2022 14:55:51 +0800 Subject: [PATCH] test: add test case for tmq --- tests/system-test/7-tmq/tmqDnodeRestart1.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/system-test/7-tmq/tmqDnodeRestart1.py b/tests/system-test/7-tmq/tmqDnodeRestart1.py index 8a826cc273..054afe4fef 100644 --- a/tests/system-test/7-tmq/tmqDnodeRestart1.py +++ b/tests/system-test/7-tmq/tmqDnodeRestart1.py @@ -200,12 +200,18 @@ class TDTestCase: tdLog.info("start consume processor") tmqCom.startTmqSimProcess(pollDelay=paraDict['pollDelay'],dbName=paraDict["dbName"],showMsg=paraDict['showMsg'], showRow=paraDict['showRow'],snapshot=paraDict['snapshot']) - # time.sleep(3) - tmqCom.getStartCommitNotifyFromTmqsim() + tmqCom.getStartCommitNotifyFromTmqsim('cdb',1) + + tdLog.info("create some new child table and insert data for latest mode") + paraDict["batchNum"] = 100 + paraDict["ctbPrefix"] = 'newCtb' + paraDict["ctbNum"] = 10 + paraDict["rowsPerTbl"] = 10 + tmqCom.insert_data_with_autoCreateTbl(tdSql,paraDict["dbName"],paraDict["stbName"],paraDict["ctbPrefix"],paraDict["ctbNum"],paraDict["rowsPerTbl"],paraDict["batchNum"]) + tdLog.info("================= restart dnode ===========================") tdDnodes.stoptaosd(1) tdDnodes.starttaosd(1) - # time.sleep(3) tdLog.info(" restart taosd end and wait to check consume result") expectRows = 1 @@ -214,8 +220,7 @@ class TDTestCase: for i in range(expectRows): totalConsumeRows += resultList[i] - tdSql.query(queryString) - totalRowsFromQury = tdSql.getRows() + totalRowsFromQury = paraDict["ctbNum"] * paraDict["rowsPerTbl"] tdLog.info("act consume rows: %d, act query rows: %d"%(totalConsumeRows, totalRowsFromQury)) if (totalConsumeRows < totalRowsFromQury):