Merge pull request #5138 from taosdata/xiaoping/add_test_case
Fix taosdemoTest2.py failure
This commit is contained in:
commit
efece34933
|
@ -45,6 +45,10 @@ class TDTestCase:
|
||||||
tdSql.checkData(0, 0, "2018-10-03 14:38:05")
|
tdSql.checkData(0, 0, "2018-10-03 14:38:05")
|
||||||
tdSql.checkData(1, 0, "2018-10-03 14:38:15")
|
tdSql.checkData(1, 0, "2018-10-03 14:38:15")
|
||||||
tdSql.checkData(2, 0, "2018-10-03 14:38:16")
|
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):
|
def stop(self):
|
||||||
tdSql.close()
|
tdSql.close()
|
||||||
|
|
|
@ -33,13 +33,23 @@ class TDTestCase:
|
||||||
if(threadID == 0):
|
if(threadID == 0):
|
||||||
os.system("yes | taosdemo -t %d -n %d -x" % (self.numberOfTables, self.numberOfRecords))
|
os.system("yes | taosdemo -t %d -n %d -x" % (self.numberOfTables, self.numberOfRecords))
|
||||||
if(threadID == 1):
|
if(threadID == 1):
|
||||||
|
time.sleep(2)
|
||||||
print("use test")
|
print("use test")
|
||||||
tdSql.execute("use test")
|
tdSql.execute("use test")
|
||||||
|
# check if all the tables have heen created
|
||||||
|
while True:
|
||||||
|
tdSql.query("show tables")
|
||||||
|
rows = tdSql.queryRows
|
||||||
|
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:
|
while True:
|
||||||
print("query started")
|
print("query started")
|
||||||
tdSql.query("select * from test.t9")
|
tdSql.query("select * from test.t9")
|
||||||
rows = tdSql.queryRows
|
rows = tdSql.queryRows
|
||||||
print("rows %d" % rows)
|
print("number of records: %d" % rows)
|
||||||
if(rows > 0):
|
if(rows > 0):
|
||||||
break
|
break
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
@ -54,8 +64,7 @@ class TDTestCase:
|
||||||
t1 = threading.Thread(target=self.insertDataAndAlterTable, args=(0, ))
|
t1 = threading.Thread(target=self.insertDataAndAlterTable, args=(0, ))
|
||||||
t2 = threading.Thread(target=self.insertDataAndAlterTable, args=(1, ))
|
t2 = threading.Thread(target=self.insertDataAndAlterTable, args=(1, ))
|
||||||
|
|
||||||
t1.start()
|
t1.start()
|
||||||
time.sleep(2)
|
|
||||||
t2.start()
|
t2.start()
|
||||||
t1.join()
|
t1.join()
|
||||||
t2.join()
|
t2.join()
|
||||||
|
|
Loading…
Reference in New Issue