提交 881a5506 编写于 作者: B bryanchang0603

[TD-4366 adding sleep to prevent time problem]

上级 b01865f6
......@@ -15,6 +15,7 @@ import sys
from util.log import *
from util.cases import *
from util.sql import *
import time
class TDTestCase:
......@@ -129,9 +130,6 @@ class TDTestCase:
tdSql.prepare()
##TODO: need to wait for TD-4445 to implement the following
## tests
## preset the keep
tdSql.prepare()
......@@ -176,20 +174,22 @@ class TDTestCase:
tdSql.error('insert into tb values (now-15d, 10)')
tdSql.query('select * from tb')
tdSql.checkRows(rowNum)
tdLog.notice('testing keep will be altered if sudden change from small to big')
tdSql.execute('alter database db keep 14,14,14')
tdSql.execute('alter database db keep 15,15,15')
tdSql.execute('insert into tb values (now-15d, 10)')
tdSql.query('select * from tb')
tdSql.checkRows(rowNum + 1)
for i in range(30):
tdSql.execute('alter database db keep 14,14,14')
tdSql.execute('alter database db keep 16,16,16')
tdSql.execute('insert into tb values (now-15d, 10)')
tdSql.query('select * from tb')
rowNum += 1
tdSql.checkRows(rowNum )
tdLog.notice('testing keep will be altered if sudden change from big to small')
tdSql.execute('alter database db keep 16,16,16')
tdSql.execute('alter database db keep 14,14,14')
tdSql.error('insert into tb values (now-15d, 10)')
tdSql.query('select * from tb')
tdSql.checkRows(rowNum + 1)
tdSql.checkRows(rowNum)
......
......@@ -19,6 +19,7 @@ from util.pathFinding import *
from util.dnodes import tdDnodes
from datetime import datetime
import subprocess
import time
##TODO: this is now automatic, but not sure if this will run through jenkins
class TDTestCase:
......@@ -63,6 +64,7 @@ class TDTestCase:
tdSql.query('select first(ts) from stb_0')
tdSql.checkData(0,0,datetime(2020,10,14,8,0,0,0)) #check the last data in the database
os.system('sudo timedatectl set-ntp on')
time.sleep(5)
def stop(self):
os.system('sudo timedatectl set-ntp on')
......
......@@ -71,6 +71,7 @@ class TDTestCase:
else:
tdLog.debug("data file number correct")
os.system('sudo timedatectl set-ntp on')
time.sleep(5)
def stop(self):
os.system('sudo timedatectl set-ntp on')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册