提交 6c20dfa1 编写于 作者: A Alex Duan

add check data correct case for compact database

上级 acde8586
......@@ -283,14 +283,14 @@ class TDTestCase:
# normal table
# all rows
sql = "select * from @db_name.ta"
self.queryDouble(sql)
# count
sql = "select count(*) from @db_name.ta"
self.queryDouble(sql)
# all rows
sql = "select * from @db_name.ta"
self.queryDouble(sql)
# sum
sql = "select sum(c1) from @db_name.ta"
self.queryDouble(sql)
......@@ -316,7 +316,8 @@ class TDTestCase:
tdSql.execute(sql)
# wait end
for i in range(100):
seconds = 300
for i in range(seconds):
sql ="show transactions;"
rows = tdSql.query(sql)
if rows == 0:
......@@ -325,7 +326,7 @@ class TDTestCase:
#tdLog.info(f"i={i} wait split vgroup ...")
time.sleep(1)
tdLog.exit("split vgroup transaction is not finished after executing 50s")
tdLog.exit(f"split vgroup transaction is not finished after executing {seconds}s")
return False
# split error
......@@ -382,6 +383,14 @@ class TDTestCase:
self.expectSplitError("topicdb")
tdSql.execute("drop topic toa;")
self.expectSplitOk("topicdb")
# compact and check db2
def compactAndCheck(self):
tdLog.info("compact db2 and check result ...")
# compact
tdSql.execute(f"compact database {self.db2};")
# check result
self.checkResult()
# run
def run(self):
......@@ -390,12 +399,15 @@ class TDTestCase:
for i in range(5):
# split vgroup on db2
start = time.time()
self.splitVGroup(self.db2)
end = time.time()
self.vgroups2 += 1
# check two db query result same
self.checkResult()
tdLog.info(f"split vgroup i={i} passed.")
spend = "%.3f"%(end-start)
tdLog.info(f"split vgroup i={i} passed. spend = {spend}s")
# split empty db
self.splitEmptyDB()
......@@ -403,6 +415,9 @@ class TDTestCase:
# check topic and stream forib
self.checkForbid()
# compact database
self.compactAndCheck()
# stop
def stop(self):
tdSql.close()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册