提交 86c2c8f8 编写于 作者: P Ping Xiao

Fix taosdemotest2.py failure

上级 01e47002
...@@ -33,18 +33,23 @@ class TDTestCase: ...@@ -33,18 +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: while True:
tdSql.query("show tables") tdSql.query("show tables")
rows = tdSql.queryRows rows = tdSql.queryRows
if(rows == 10): print("number of tables: %d" % rows)
break 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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册