From cea72bb3650cb1c8c46e8f6f3d2d44d2e19d57af Mon Sep 17 00:00:00 2001 From: dmchen Date: Thu, 31 Oct 2024 08:29:11 +0000 Subject: [PATCH] fix/TS-5251-add-conflict-check-fix-case --- tests/army/cluster/snapshot.py | 5 +++++ tests/army/frame/caseBase.py | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/tests/army/cluster/snapshot.py b/tests/army/cluster/snapshot.py index d18dbf2796..d14887db5c 100644 --- a/tests/army/cluster/snapshot.py +++ b/tests/army/cluster/snapshot.py @@ -97,6 +97,11 @@ class TDTestCase(TBase): self.alterReplica(1) self.checkAggCorrect() self.compactDb() + + if self.waitCompactsZero() is False: + tdLog.exit(f"compact not finished") + return False + self.alterReplica3() vgids = self.getVGroup(self.db) diff --git a/tests/army/frame/caseBase.py b/tests/army/frame/caseBase.py index 491e432df7..c2b3411e77 100644 --- a/tests/army/frame/caseBase.py +++ b/tests/army/frame/caseBase.py @@ -283,6 +283,18 @@ class TBase: time.sleep(interval) return False + def waitCompactsZero(self, seconds = 300, interval = 1): + # wait end + for i in range(seconds): + sql ="show compacts;" + rows = tdSql.query(sql) + if rows == 0: + tdLog.info("compacts count became zero.") + return True + #tdLog.info(f"i={i} wait ...") + time.sleep(interval) + + return False # check file exist def checkFileExist(self, pathFile):