Merge pull request #30160 from taosdata/fix/test_case

test(stream): add status check before pause/resume streams.
This commit is contained in:
Simon Guan 2025-03-13 16:39:37 +08:00 committed by GitHub
commit a2d19b1b7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

View File

@ -8,6 +8,7 @@
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
import time
# -*- coding: utf-8 -*-
@ -88,6 +89,17 @@ class TDTestCase:
return True
def restart_stream(self):
st = time.time()
while True:
sql = 'select status from information_schema.ins_stream_tasks where status<>"ready" '
if len(tdSql.getResult(sql)) != 0:
time.sleep(1)
tdLog.info("wait for task to be ready, 1s")
else:
et = time.time()
tdLog.info(f"wait for tasks to be ready: {et-st}s")
break
tdLog.debug("========restart stream========")
for i in range(5):
tdSql.execute("pause stream s1")