[TD-4711] trying to solve the problem of ntp not swtich on

This commit is contained in:
bryanchang0603 2021-06-15 13:05:30 +08:00
parent 67d6339f1a
commit 08a9a1f765
2 changed files with 21 additions and 8 deletions

View File

@ -56,8 +56,8 @@ class TDTestCase:
#move 5 days ahead to 2020/10/25. 4 oldest files should be removed during the new write #move 5 days ahead to 2020/10/25. 4 oldest files should be removed during the new write
#leaving 7 data files. #leaving 7 data files.
os.system ('timedatectl set-time 2020-10-25')
try: try:
os.system ('timedatectl set-time 2020-10-25')
os.system(f"{binPath}taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_B.json") os.system(f"{binPath}taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_B.json")
except BaseException: except BaseException:
os.system('sudo timedatectl set-ntp on') os.system('sudo timedatectl set-ntp on')
@ -78,6 +78,7 @@ class TDTestCase:
def stop(self): def stop(self):
os.system('sudo timedatectl set-ntp on') os.system('sudo timedatectl set-ntp on')
tdLog.sleep(10)
tdSql.close() tdSql.close()
tdLog.success("alter block manual check finish") tdLog.success("alter block manual check finish")

View File

@ -54,8 +54,14 @@ class TDTestCase:
else: else:
tdLog.debug("data file number correct") tdLog.debug("data file number correct")
tdSql.query('select first(ts) from stb_0') #check the last data in the database
tdSql.checkData(0,0,datetime(2020,10,11,0,0,0,0)) try:
tdSql.query('select first(ts) from stb_0') #check the last data in the database
tdSql.checkData(0,0,datetime(2020,10,11,0,0,0,0))
except BaseException:
os.system('sudo timedatectl set-ntp on')
tdLog.sleep(10)
os.system ('timedatectl set-time 2020-10-25') os.system ('timedatectl set-time 2020-10-25')
@ -63,11 +69,17 @@ class TDTestCase:
#4 oldest data file should be removed from tsdb/data #4 oldest data file should be removed from tsdb/data
#7 data file should be found #7 data file should be found
#vnode at TDinternal/community/sim/dnode1/data/vnode #vnode at TDinternal/community/sim/dnode1/data/vnode
os.system ('timedatectl set-time 2020-10-25')
tdDnodes.stop(1) try:
tdDnodes.start(1) os.system ('timedatectl set-time 2020-10-25')
tdSql.query('select first(ts) from stb_0') tdDnodes.stop(1)
tdSql.checkData(0,0,datetime(2020,10,14,8,0,0,0)) #check the last data in the database tdDnodes.start(1)
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
except BaseException:
os.system('sudo timedatectl set-ntp on')
tdLog.sleep(10)
os.system('sudo timedatectl set-ntp on') os.system('sudo timedatectl set-ntp on')
tdLog.sleep(10) tdLog.sleep(10)
commandArray = ['ls', '-l', f'{TDenginePath}/sim/dnode1/data/vnode/vnode2/tsdb/data'] commandArray = ['ls', '-l', f'{TDenginePath}/sim/dnode1/data/vnode/vnode2/tsdb/data']