提交 c51a9ec4 编写于 作者: A Alex Duan

test: wal retetion period and size case passed

上级 e2b5444c
...@@ -33,8 +33,6 @@ from datetime import datetime ...@@ -33,8 +33,6 @@ from datetime import datetime
from datetime import timedelta from datetime import timedelta
from os import path from os import path
stopInsert = False
# #
# -------------- util -------------------------- # -------------- util --------------------------
...@@ -148,7 +146,6 @@ class VNode : ...@@ -148,7 +146,6 @@ class VNode :
# vnode # vnode
def check_retention(self): def check_retention(self):
global stopInsert
# #
# check period # check period
# #
...@@ -314,7 +311,6 @@ class TDTestCase: ...@@ -314,7 +311,6 @@ class TDTestCase:
# insert to child table d1 data # insert to child table d1 data
def insert_data(self, tbname, insertTime): def insert_data(self, tbname, insertTime):
global stopInsert
start = time.time() start = time.time()
values = "" values = ""
child_name = "" child_name = ""
...@@ -331,11 +327,11 @@ class TDTestCase: ...@@ -331,11 +327,11 @@ class TDTestCase:
cost = time.time() - start cost = time.time() - start
if j % 100 == 0: if j % 100 == 0:
tdSql.execute(f"flush database {self.dbname}") tdSql.execute(f"flush database {self.dbname}")
print(f' cost={cost} j ={j} \n') tdLog.info(" insert row cost time = %ds rows = %d"%(cost, j))
if cost > insertTime and j > 1000: if cost > insertTime and j > 1000:
tdLog.info(f" insert finished. cost time ={cost}s rows={j}") tdLog.info(" insert finished. cost time = %ds rows = %d"%(cost, j))
return return
# create tmq # create tmq
def create_tmq(self): def create_tmq(self):
...@@ -355,6 +351,8 @@ class TDTestCase: ...@@ -355,6 +351,8 @@ class TDTestCase:
for dnode in os.listdir(self.projDir): for dnode in os.listdir(self.projDir):
vnodeDir = self.projDir + f"{dnode}/data/vnode/" vnodeDir = self.projDir + f"{dnode}/data/vnode/"
print(f"vnodeDir={vnodeDir}") print(f"vnodeDir={vnodeDir}")
if dnode == "psim":
continue
# enum all vnode # enum all vnode
for entry in os.listdir(vnodeDir): for entry in os.listdir(vnodeDir):
entryPath = path.join(vnodeDir, entry) entryPath = path.join(vnodeDir, entry)
...@@ -373,13 +371,11 @@ class TDTestCase: ...@@ -373,13 +371,11 @@ class TDTestCase:
# test db1 # test db1
def test_db(self, dbname, checkTime ,wal_period, wal_size_kb): def test_db(self, dbname, checkTime ,wal_period, wal_size_kb):
global stopInsert
# var # var
stable = "meters" stable = "meters"
tbname = "d" tbname = "d"
vgroups = 4 vgroups = 6
count = 10 count = 20
rows = 1000000
# do # do
self.create_database(dbname, wal_period, wal_size_kb, vgroups) self.create_database(dbname, wal_period, wal_size_kb, vgroups)
...@@ -389,7 +385,6 @@ class TDTestCase: ...@@ -389,7 +385,6 @@ class TDTestCase:
self.create_tmq() self.create_tmq()
# insert data # insert data
self.insert_data(tbname, checkTime) self.insert_data(tbname, checkTime)
#stopInsert = False #stopInsert = False
...@@ -403,8 +398,6 @@ class TDTestCase: ...@@ -403,8 +398,6 @@ class TDTestCase:
# stop insert and wait exit # stop insert and wait exit
tdLog.info(f" {dbname} stop insert ...") tdLog.info(f" {dbname} stop insert ...")
stopInsert = True
tobj.join()
tdLog.info(f" {dbname} test_db end.") tdLog.info(f" {dbname} test_db end.")
# run # run
...@@ -413,8 +406,9 @@ class TDTestCase: ...@@ -413,8 +406,9 @@ class TDTestCase:
#self.test_db("db1", 10, 60, 0) #self.test_db("db1", 10, 60, 0)
# size # size
#self.test_db("db2", 5, 10*24*3600, 2*1024) # 2M size #self.test_db("db2", 5, 10*24*3600, 2*1024) # 2M size
# period + size # period + size
self.test_db("db3", checkTime = 2*60, wal_period = 30, wal_size_kb=10) self.test_db("db", checkTime = 30*60, wal_period = 60, wal_size_kb=10)
def stop(self): def stop(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册