From 7271e040d44851757c8b785926a44bd1aff306a5 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Thu, 8 Aug 2024 12:56:13 +0800 Subject: [PATCH] fix: restore delete_check.py case --- tests/parallel_test/cases.task | 2 +- tests/system-test/0-others/delete_check.py | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index e70042001d..2b0ddc8166 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -340,7 +340,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/splitVGroup.py -N 3 -n 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/splitVGroupWal.py -N 3 -n 3 ,,n,system-test,python3 ./test.py -f 0-others/timeRangeWise.py -N 3 -#,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/delete_check.py +,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/delete_check.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/test_hot_refresh_configurations.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/subscribe_stream_privilege.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/empty_identifier.py diff --git a/tests/system-test/0-others/delete_check.py b/tests/system-test/0-others/delete_check.py index ec589295e4..468ca63919 100644 --- a/tests/system-test/0-others/delete_check.py +++ b/tests/system-test/0-others/delete_check.py @@ -47,9 +47,9 @@ class TDTestCase: def compactDatbase(self): # compact database tdSql.execute(f"compact database {self.dbname}", show=True) - waitSeconds = 20 - if self.waitTranslation(waitSeconds) == False: - tdLog.exit(f"translation can not finish after wait {waitSeconds} seconds") + waitSeconds = 60 + if self.waitCompacts(waitSeconds) == False: + tdLog.exit(f"compacts can not finish after wait {waitSeconds} seconds") return # check tsdb folder empty @@ -108,6 +108,19 @@ class TDTestCase: return False + def waitCompacts(self, waitSeconds): + # wait end + for i in range(waitSeconds): + sql ="show compacts;" + rows = tdSql.query(sql) + if rows == 0: + return True + tdLog.info(f"i={i} wait for translation finish ...") + time.sleep(1) + + return False + + # run def run(self): # seed