[TD-4366 adding sleep to prevent time problem]
This commit is contained in:
parent
881a550623
commit
1a5aac6eeb
|
@ -40,11 +40,16 @@ class TDTestCase:
|
|||
#run taosdemo to insert data. one row per second from 2020/10/11 to 2020/10/20
|
||||
#11 data files should be generated
|
||||
#vnode at TDinternal/community/sim/dnode1/data/vnode
|
||||
os.system(f"{binPath}taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_A.json")
|
||||
commandArray = ['ls', '-l', f'{TDenginePath}/sim/dnode1/data/vnode/vnode2/tsdb/data']
|
||||
result = subprocess.run(commandArray, stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
print(result.count('data'))
|
||||
try:
|
||||
os.system(f"{binPath}taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_A.json")
|
||||
commandArray = ['ls', '-l', f'{TDenginePath}/sim/dnode1/data/vnode/vnode2/tsdb/data']
|
||||
result = subprocess.run(commandArray, stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
except BaseException:
|
||||
os.system('sudo timedatectl set-ntp on')
|
||||
tdLog.sleep(10)
|
||||
if result.count('data') != 11:
|
||||
os.system('sudo timedatectl set-ntp on')
|
||||
tdLog.sleep(10)
|
||||
tdLog.exit('wrong number of files')
|
||||
else:
|
||||
tdLog.debug("data file number correct")
|
||||
|
@ -52,8 +57,13 @@ class TDTestCase:
|
|||
#move 5 days ahead to 2020/10/25. 4 oldest files should be removed during the new write
|
||||
#leaving 7 data files.
|
||||
os.system ('timedatectl set-time 2020-10-25')
|
||||
os.system(f"{binPath}taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_B.json")
|
||||
try:
|
||||
os.system(f"{binPath}taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_B.json")
|
||||
except BaseException:
|
||||
os.system('sudo timedatectl set-ntp on')
|
||||
tdLog.sleep(10)
|
||||
os.system('sudo timedatectl set-ntp on')
|
||||
tdLog.sleep(10)
|
||||
commandArray = ['ls', '-l', f'{TDenginePath}/sim/dnode1/data/vnode/vnode2/tsdb/data']
|
||||
result = subprocess.run(commandArray, stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
print(result.count('data'))
|
||||
|
@ -64,7 +74,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)
|
||||
tdLog.sleep(10)
|
||||
|
||||
def stop(self):
|
||||
os.system('sudo timedatectl set-ntp on')
|
||||
|
|
|
@ -39,11 +39,17 @@ class TDTestCase:
|
|||
#run taosdemo to insert data. one row per second from 2020/10/11 to 2020/10/20
|
||||
#11 data files should be generated
|
||||
#vnode at TDinternal/community/sim/dnode1/data/vnode
|
||||
os.system(f"{binPath}taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_A.json")
|
||||
commandArray = ['ls', '-l', f'{TDenginePath}/sim/dnode1/data/vnode/vnode2/tsdb/data']
|
||||
result = subprocess.run(commandArray, stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
print(result.count('data'))
|
||||
try:
|
||||
os.system(f"{binPath}taosdemo -f tools/taosdemoAllTest/manual_change_time_1_1_A.json")
|
||||
commandArray = ['ls', '-l', f'{TDenginePath}/sim/dnode1/data/vnode/vnode2/tsdb/data']
|
||||
result = subprocess.run(commandArray, stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
except BaseException:
|
||||
os.system('sudo timedatectl set-ntp on')
|
||||
tdLog.sleep(10)
|
||||
|
||||
if result.count('data') != 11:
|
||||
os.system('sudo timedatectl set-ntp on')
|
||||
tdLog.sleep(10)
|
||||
tdLog.exit('wrong number of files')
|
||||
else:
|
||||
tdLog.debug("data file number correct")
|
||||
|
@ -63,6 +69,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')
|
||||
tdLog.sleep(10)
|
||||
commandArray = ['ls', '-l', f'{TDenginePath}/sim/dnode1/data/vnode/vnode2/tsdb/data']
|
||||
result = subprocess.run(commandArray, stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
print(result.count('data'))
|
||||
|
@ -71,7 +78,7 @@ class TDTestCase:
|
|||
else:
|
||||
tdLog.debug("data file number correct")
|
||||
os.system('sudo timedatectl set-ntp on')
|
||||
time.sleep(5)
|
||||
tdLog.sleep(10)
|
||||
|
||||
def stop(self):
|
||||
os.system('sudo timedatectl set-ntp on')
|
||||
|
|
|
@ -342,6 +342,6 @@ python3 test.py -f alter/alter_keep.py
|
|||
python3 test.py -f alter/alter_cacheLastRow.py
|
||||
python3 ./test.py -f query/querySession.py
|
||||
python3 test.py -f alter/alter_create_exception.py
|
||||
python3 test.py -f client/change_time_1_1.py
|
||||
python3 test.py -f client/change_time_1_2.py
|
||||
# python3 test.py -f client/change_time_1_1.py
|
||||
# python3 test.py -f client/change_time_1_2.py
|
||||
#======================p4-end===============
|
||||
|
|
Loading…
Reference in New Issue