Merge pull request #27964 from taosdata/test/3.0/TS-5392

add case by TS-5392 and improve ‘reset log file’ check
This commit is contained in:
Feng Chao 2024-09-20 09:13:50 +08:00 committed by GitHub
commit adc12a89e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 3 deletions

View File

@ -157,6 +157,12 @@ class TDTestCase:
"alias": "tsLogKeepDays",
"values": [-365000, 10, 365000],
"except_values": [-365001, 365001]
},
{
"name": "syncLogBufferMemoryAllowed",
"alias": "syncLogBufferMemoryAllowed",
"values": [104857600, 1048576000, 9223372036854775807],
"except_values": [-104857600, 104857599, 9223372036854775808]
}
]
}
@ -235,11 +241,15 @@ class TDTestCase:
def run(self):
# reset log
taosdLogAbsoluteFilename = tdCom.getTaosdPath() + "/log/" + "taosdlog*"
taosdLogPath = tdCom.getTaosdPath() + "/log/*"
tdSql.execute("alter all dnodes 'resetlog';")
r = subprocess.Popen("cat {} | grep 'reset log file'".format(taosdLogAbsoluteFilename), shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
time.sleep(1)
cmd = "egrep 'reset log file' {}".format(taosdLogPath)
tdLog.debug("run cmd: {}".format(cmd))
r = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = r.communicate()
tdLog.debug("stdout: {}".format(stdout.decode()))
tdLog.debug("stderr: {}".format(stderr.decode()))
assert ('reset log file' in stdout.decode())
for key in self.configration_dic: