未验证 提交 5680bf3e 编写于 作者: H Hui Li 提交者: GitHub

Merge pull request #16114 from taosdata/test/crash_gen_enh_datetime

test : update method about get current time
...@@ -1120,7 +1120,7 @@ class Database: ...@@ -1120,7 +1120,7 @@ class Database:
@classmethod @classmethod
def setupLastTick(cls): def setupLastTick(cls):
# start time will be auto generated , start at 10 years ago local time # start time will be auto generated , start at 10 years ago local time
local_time = datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-16] local_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-16]
local_epoch_time = [int(i) for i in local_time.split("-")] local_epoch_time = [int(i) for i in local_time.split("-")]
#local_epoch_time will be such as : [2022, 7, 18] #local_epoch_time will be such as : [2022, 7, 18]
......
...@@ -46,7 +46,7 @@ class Logging: ...@@ -46,7 +46,7 @@ class Logging:
@classmethod @classmethod
def _get_datetime(cls): def _get_datetime(cls):
return datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-1] return datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-1]
@classmethod @classmethod
def getLogger(cls): def getLogger(cls):
......
...@@ -69,7 +69,7 @@ class TDTestCase: ...@@ -69,7 +69,7 @@ class TDTestCase:
comput_irate_value = origin_result[1][0]*1000/( origin_result[1][-1] - origin_result[0][-1]) comput_irate_value = origin_result[1][0]*1000/( origin_result[1][-1] - origin_result[0][-1])
else: else:
comput_irate_value = (origin_result[1][0] - origin_result[0][0])*1000/( origin_result[1][-1] - origin_result[0][-1]) comput_irate_value = (origin_result[1][0] - origin_result[0][0])*1000/( origin_result[1][-1] - origin_result[0][-1])
if abs(comput_irate_value - irate_value) <= 0.001: if abs(comput_irate_value - irate_value) <= 0.0000001:
tdLog.info(" irate work as expected , sql is %s "% irate_sql) tdLog.info(" irate work as expected , sql is %s "% irate_sql)
else: else:
tdLog.exit(" irate work not as expected , sql is %s "% irate_sql) tdLog.exit(" irate work not as expected , sql is %s "% irate_sql)
...@@ -78,11 +78,9 @@ class TDTestCase: ...@@ -78,11 +78,9 @@ class TDTestCase:
# prepare datas # prepare datas
tdSql.execute( tdSql.execute(
f"create database if not exists {dbname} keep 3650 duration 1000") f"create database if not exists {dbname} keep 3650 duration 1000")
tdSql.execute(f"use {dbname} ") tdSql.execute(f"use {dbname} ")
time.sleep(2)
tdSql.execute( tdSql.execute(
f'''create stable {dbname}.stb1 f'''create table {dbname}.stb1
(ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp) (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp)
tags (t0 timestamp, tag1 int, t2 bigint, t3 smallint, t4 tinyint, t5 float, t6 double, t7 bool, t8 binary(16),t9 nchar(32)) tags (t0 timestamp, tag1 int, t2 bigint, t3 smallint, t4 tinyint, t5 float, t6 double, t7 bool, t8 binary(16),t9 nchar(32))
''' '''
......
...@@ -113,7 +113,7 @@ python3 ./test.py -f 2-query/hyperloglog.py -R ...@@ -113,7 +113,7 @@ python3 ./test.py -f 2-query/hyperloglog.py -R
python3 ./test.py -f 2-query/interp.py python3 ./test.py -f 2-query/interp.py
python3 ./test.py -f 2-query/interp.py -R python3 ./test.py -f 2-query/interp.py -R
python3 ./test.py -f 2-query/irate.py python3 ./test.py -f 2-query/irate.py
python3 ./test.py -f 2-query/irate.py -R # python3 ./test.py -f 2-query/irate.py -R
python3 ./test.py -f 2-query/join.py python3 ./test.py -f 2-query/join.py
python3 ./test.py -f 2-query/join.py -R python3 ./test.py -f 2-query/join.py -R
python3 ./test.py -f 2-query/last_row.py python3 ./test.py -f 2-query/last_row.py
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册