From 86c2c8f871b78c5418633f0fdc578c3f0640b5ff Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Thu, 4 Feb 2021 10:58:11 +0800 Subject: [PATCH] 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) -- GitLab