From b04bc1aee239f94b9c991e9cbafe72591028e00b Mon Sep 17 00:00:00 2001 From: "wenzhouwww@live.cn" Date: Mon, 15 Aug 2022 16:34:38 +0800 Subject: [PATCH 1/5] test:update metchod about get current datetime --- tests/pytest/crash_gen/crash_gen_main.py | 2 +- tests/pytest/crash_gen/shared/misc.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pytest/crash_gen/crash_gen_main.py b/tests/pytest/crash_gen/crash_gen_main.py index 203541f14a..600c64b8e6 100755 --- a/tests/pytest/crash_gen/crash_gen_main.py +++ b/tests/pytest/crash_gen/crash_gen_main.py @@ -1120,7 +1120,7 @@ class Database: @classmethod def setupLastTick(cls): # 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 will be such as : [2022, 7, 18] diff --git a/tests/pytest/crash_gen/shared/misc.py b/tests/pytest/crash_gen/shared/misc.py index fd73f97fcb..6a8a59a027 100644 --- a/tests/pytest/crash_gen/shared/misc.py +++ b/tests/pytest/crash_gen/shared/misc.py @@ -46,7 +46,7 @@ class Logging: @classmethod 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 def getLogger(cls): From a874c5c8e98df54bae96323fc94346e836127186 Mon Sep 17 00:00:00 2001 From: wenzhouwww Date: Mon, 15 Aug 2022 16:37:49 +0800 Subject: [PATCH 2/5] Update irate.py --- tests/system-test/2-query/irate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/2-query/irate.py b/tests/system-test/2-query/irate.py index 9738879145..47998abbe7 100644 --- a/tests/system-test/2-query/irate.py +++ b/tests/system-test/2-query/irate.py @@ -69,7 +69,7 @@ class TDTestCase: comput_irate_value = origin_result[1][0]*1000/( origin_result[1][-1] - origin_result[0][-1]) else: 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) else: tdLog.exit(" irate work not as expected , sql is %s "% irate_sql) From ac39e06207c9ab28fe5772014e99d743ed20aca7 Mon Sep 17 00:00:00 2001 From: wenzhouwww Date: Mon, 15 Aug 2022 16:38:17 +0800 Subject: [PATCH 3/5] Update irate.py --- tests/system-test/2-query/irate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/2-query/irate.py b/tests/system-test/2-query/irate.py index 47998abbe7..80e32a9885 100644 --- a/tests/system-test/2-query/irate.py +++ b/tests/system-test/2-query/irate.py @@ -82,7 +82,7 @@ class TDTestCase: tdSql.execute(f"use {dbname} ") time.sleep(2) 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) tags (t0 timestamp, tag1 int, t2 bigint, t3 smallint, t4 tinyint, t5 float, t6 double, t7 bool, t8 binary(16),t9 nchar(32)) ''' From 0a75d71b55f33b1e8de1ad653c3a8d1f921acb37 Mon Sep 17 00:00:00 2001 From: wenzhouwww Date: Mon, 15 Aug 2022 16:39:05 +0800 Subject: [PATCH 4/5] Update irate.py --- tests/system-test/2-query/irate.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/system-test/2-query/irate.py b/tests/system-test/2-query/irate.py index 80e32a9885..a64e7695c3 100644 --- a/tests/system-test/2-query/irate.py +++ b/tests/system-test/2-query/irate.py @@ -78,9 +78,7 @@ class TDTestCase: # prepare datas tdSql.execute( f"create database if not exists {dbname} keep 3650 duration 1000") - tdSql.execute(f"use {dbname} ") - time.sleep(2) tdSql.execute( 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) From 35359ed4595df5b245d4b755668c677aa54be5da Mon Sep 17 00:00:00 2001 From: wenzhouwww Date: Mon, 15 Aug 2022 16:39:29 +0800 Subject: [PATCH 5/5] Update fulltest.sh --- tests/system-test/fulltest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index f3bbbfc562..e9331de6bf 100755 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -111,7 +111,7 @@ python3 ./test.py -f 2-query/histogram.py -R python3 ./test.py -f 2-query/hyperloglog.py python3 ./test.py -f 2-query/hyperloglog.py -R 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 -R