From 01e47002ea407d49646f43d73a320c59026582b4 Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Thu, 4 Feb 2021 10:29:30 +0800 Subject: [PATCH 1/3] Fix taosdemoTest2.py failure --- tests/pytest/tools/taosdemoTest2.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/pytest/tools/taosdemoTest2.py b/tests/pytest/tools/taosdemoTest2.py index 4d7e871e66..daaf83b869 100644 --- a/tests/pytest/tools/taosdemoTest2.py +++ b/tests/pytest/tools/taosdemoTest2.py @@ -34,7 +34,12 @@ class TDTestCase: os.system("yes | taosdemo -t %d -n %d -x" % (self.numberOfTables, self.numberOfRecords)) if(threadID == 1): print("use test") - tdSql.execute("use test") + tdSql.execute("use test") + while True: + tdSql.query("show tables") + rows = tdSql.queryRows + if(rows == 10): + break while True: print("query started") tdSql.query("select * from test.t9") @@ -54,8 +59,7 @@ class TDTestCase: t1 = threading.Thread(target=self.insertDataAndAlterTable, args=(0, )) t2 = threading.Thread(target=self.insertDataAndAlterTable, args=(1, )) - t1.start() - time.sleep(2) + t1.start() t2.start() t1.join() t2.join() From 86c2c8f871b78c5418633f0fdc578c3f0640b5ff Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Thu, 4 Feb 2021 10:58:11 +0800 Subject: [PATCH 2/3] Fix taosdemotest2.py failure --- tests/pytest/tools/taosdemoTest2.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/pytest/tools/taosdemoTest2.py b/tests/pytest/tools/taosdemoTest2.py index daaf83b869..1e492aa8fc 100644 --- a/tests/pytest/tools/taosdemoTest2.py +++ b/tests/pytest/tools/taosdemoTest2.py @@ -33,18 +33,23 @@ class TDTestCase: if(threadID == 0): os.system("yes | taosdemo -t %d -n %d -x" % (self.numberOfTables, self.numberOfRecords)) if(threadID == 1): + time.sleep(2) print("use test") tdSql.execute("use test") + # check if all the tables have heen created while True: tdSql.query("show tables") rows = tdSql.queryRows - if(rows == 10): - break + print("number of tables: %d" % rows) + if(rows == self.numberOfTables): + break + time.sleep(1) + # check if there are any records in the last created table while True: print("query started") tdSql.query("select * from test.t9") rows = tdSql.queryRows - print("rows %d" % rows) + print("number of records: %d" % rows) if(rows > 0): break time.sleep(1) From b788f3d8e4bbd2366020f816a2606842559bc200 Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Thu, 4 Feb 2021 11:51:28 +0800 Subject: [PATCH 3/3] [TD-1351]: add test case --- tests/pytest/query/queryGroupbySort.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/pytest/query/queryGroupbySort.py b/tests/pytest/query/queryGroupbySort.py index 80f6d55aae..c2649a86db 100644 --- a/tests/pytest/query/queryGroupbySort.py +++ b/tests/pytest/query/queryGroupbySort.py @@ -45,6 +45,10 @@ class TDTestCase: tdSql.checkData(0, 0, "2018-10-03 14:38:05") tdSql.checkData(1, 0, "2018-10-03 14:38:15") tdSql.checkData(2, 0, "2018-10-03 14:38:16") + + tdSql.error("SELECT SUM(current) as s, AVG(voltage) FROM meters WHERE groupId > 1 INTERVAL(1s) GROUP BY location order by s ASC") + + tdSql.error("SELECT SUM(current) as s, AVG(voltage) FROM meters WHERE groupId > 1 INTERVAL(1s) GROUP BY location order by s DESC") def stop(self): tdSql.close()