[TD-4366 adding sleep to prevent time problem]

This commit is contained in:
bryanchang0603 2021-06-15 09:24:15 +08:00
parent b01865f6c4
commit 881a550623
3 changed files with 13 additions and 10 deletions

View File

@ -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)

View File

@ -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')

View File

@ -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')