未验证 提交 748cc419 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #3998 from taosdata/bugfix/td-1287

[TD-1287]<fix>: fix failed test case
...@@ -26,7 +26,6 @@ class TDTestCase: ...@@ -26,7 +26,6 @@ class TDTestCase:
def run(self): def run(self):
rowNum = 200 rowNum = 200
totalNum = 200
tdSql.prepare() tdSql.prepare()
tdLog.info("=============== step1") tdLog.info("=============== step1")
...@@ -42,7 +41,9 @@ class TDTestCase: ...@@ -42,7 +41,9 @@ class TDTestCase:
tdSql.execute("create table st as select count(*), count(tbcol), count(tbcol2) from mt interval(10s)") tdSql.execute("create table st as select count(*), count(tbcol), count(tbcol2) from mt interval(10s)")
tdLog.info("=============== step3") tdLog.info("=============== step3")
start = time.time()
tdSql.waitedQuery("select * from st", 1, 120) tdSql.waitedQuery("select * from st", 1, 120)
delay = int(time.time() - start) + 20
v = tdSql.getData(0, 3) v = tdSql.getData(0, 3)
if v >= 51: if v >= 51:
tdLog.exit("value is %d, which is larger than 51" % v) tdLog.exit("value is %d, which is larger than 51" % v)
...@@ -54,11 +55,18 @@ class TDTestCase: ...@@ -54,11 +55,18 @@ class TDTestCase:
tdSql.execute("insert into tb%d values(now + %ds, %d, %d)" % (i, j, j, j)) tdSql.execute("insert into tb%d values(now + %ds, %d, %d)" % (i, j, j, j))
tdLog.info("=============== step5") tdLog.info("=============== step5")
tdLog.sleep(40) maxValue = 0
tdSql.waitedQuery("select * from st order by ts desc", 1, 120) for i in range(delay):
v = tdSql.getData(0, 3) time.sleep(1)
if v <= 51: tdSql.query("select * from st order by ts desc")
tdLog.exit("value is %d, which is smaller than 51" % v) v = tdSql.getData(0, 3)
if v > maxValue:
maxValue = v
if v > 51:
break
if maxValue <= 51:
tdLog.exit("value is %d, which is smaller than 51" % maxValue)
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册