diff --git a/tests/pytest/alter/alter_keep.py b/tests/pytest/alter/alter_keep.py index 9f66b08823d4a137dd16a323e43463d7d6189c6a..72ca635ac3df60eb0caaf206220eea279420be5b 100644 --- a/tests/pytest/alter/alter_keep.py +++ b/tests/pytest/alter/alter_keep.py @@ -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) diff --git a/tests/pytest/client/change_time_1_1.py b/tests/pytest/client/change_time_1_1.py index abae49a41f32aeb482a3eb8b06ff4485ec7757e9..54984747b522741a73955a988d16c4a19fef251b 100644 --- a/tests/pytest/client/change_time_1_1.py +++ b/tests/pytest/client/change_time_1_1.py @@ -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') diff --git a/tests/pytest/client/change_time_1_2.py b/tests/pytest/client/change_time_1_2.py index 855b04873c172682f7c869487ee6a254e1f36787..0937080b5cdc210af9be190c12e143bf185c8a8c 100644 --- a/tests/pytest/client/change_time_1_2.py +++ b/tests/pytest/client/change_time_1_2.py @@ -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')