From ea6e79f4eab9bcb7ac0050c17db20d06f6a1dd87 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Fri, 14 Jul 2023 17:18:06 +0800 Subject: [PATCH] test: modify loop = 60 --- tests/system-test/0-others/timeRangeWise.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/system-test/0-others/timeRangeWise.py b/tests/system-test/0-others/timeRangeWise.py index d558b1d693..a49457c8e9 100644 --- a/tests/system-test/0-others/timeRangeWise.py +++ b/tests/system-test/0-others/timeRangeWise.py @@ -217,7 +217,7 @@ class TDTestCase: tdSql.init(conn.cursor(), True) # check query result same - def queryDouble(self, sql): + def queryDoubleImpl(self, sql): # sql sql1 = sql.replace('@db_name', self.db1) tdLog.info(sql1) @@ -237,7 +237,7 @@ class TDTestCase: rowlen2 = len(res2) if rowlen1 != rowlen2: - tdLog.exit(f"rowlen1={rowlen1} rowlen2={rowlen2} both not equal.") + tdLog.info(f"check error. rowlen1={rowlen1} rowlen2={rowlen2} both not equal.") return False for i in range(rowlen1): @@ -246,7 +246,7 @@ class TDTestCase: collen1 = len(row1) collen2 = len(row2) if collen1 != collen2: - tdLog.exit(f"collen1={collen1} collen2={collen2} both not equal.") + tdLog.info(f"checkerror. collen1={collen1} collen2={collen2} both not equal.") return False for j in range(collen1): if row1[j] != row2[j]: @@ -261,6 +261,17 @@ class TDTestCase: return True + # check query result same + def queryDouble(self, sql, tryCount=60, gap=1): + for i in range(tryCount): + if self.queryDoubleImpl(sql): + return True + # error + tdLog.info(f"queryDouble return false, try loop={i}") + time.sleep(gap) + + tdLog.exit(f"queryDouble try {tryCount} times, but all failed.") + return False # check result def checkResult(self): -- GitLab