From 83cc432bf9d2f4a783ba5d586696063b0ccc6fef Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 13 Mar 2025 14:55:22 +0800 Subject: [PATCH] test(stream): add status check before pause/resume streams. --- tests/system-test/8-stream/checkpoint_info2.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/system-test/8-stream/checkpoint_info2.py b/tests/system-test/8-stream/checkpoint_info2.py index 3dc57477f7..0f18b04feb 100644 --- a/tests/system-test/8-stream/checkpoint_info2.py +++ b/tests/system-test/8-stream/checkpoint_info2.py @@ -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")