fix: add check s3 upload over logic

This commit is contained in:
Alex Duan 2024-02-22 16:47:27 +08:00
parent 73ec02ceb4
commit d8361e979c
1 changed files with 11 additions and 3 deletions

View File

@ -81,15 +81,23 @@ class TDTestCase(TBase):
cmd = f"ls {rootPath}/dnode1/data20/vnode/vnode*/tsdb/*.data" cmd = f"ls {rootPath}/dnode1/data20/vnode/vnode*/tsdb/*.data"
tdLog.info(cmd) tdLog.info(cmd)
loop = 0 loop = 0
while len(eos.runRetList(cmd)) > 0 and loop < 100: rets = []
time.sleep(5) while loop < 500:
rets = eos.runRetList(cmd)
cnt = len(rets)
if cnt == 0:
tdLog.info("All data file upload to server over.")
break
time.sleep(3)
self.trimDb(True) self.trimDb(True)
loop += 1 loop += 1
tdLog.info(f"loop={loop} wait 5s...") tdLog.info(f"loop={loop} data files have {cnt} wait 5s...")
if loop == 4: if loop == 4:
sc.dnodeStop(1) sc.dnodeStop(1)
time.sleep(2) time.sleep(2)
sc.dnodeStart(1) sc.dnodeStart(1)
if len(rets) > 0:
tdLog.exit(f"s3 can not upload all data to server. data files={rets}")
def checkStreamCorrect(self): def checkStreamCorrect(self):
sql = f"select count(*) from {self.db}.stm1" sql = f"select count(*) from {self.db}.stm1"