Merge pull request #29587 from taosdata/docs/readme-crashgen

doc: add Chaos Test to README and update some functions
This commit is contained in:
Feng Chao 2025-01-16 16:36:42 +08:00 committed by GitHub
commit 320fcbf0ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 47 additions and 37 deletions

View File

@ -163,12 +163,16 @@ cd /root/TDengine/packaging/smokeTest
## 3.3 Chaos Test
[Desciprtion]
A simple tool to exercise various functions of the system in a randomized fashion, hoping to expose maximum number of problems, hopefully without a pre-determined scenario.
### How to run test?
[Placeholder]
```bash
cd tests/pytest
python3 auto_crash_gen.py
```
### How to add new case?
[Placeholder]
Add a function, such as TaskCreateNewFunction, to pytest/crash_gen/crash_gen_main.py.
Integrate TaskCreateNewFunction into the balance_pickTaskType function in crash_gen_main.py.

View File

@ -244,7 +244,7 @@ def start_taosd():
else:
pass
start_cmd = 'cd %s && python3 test.py >>/dev/null '%(start_path)
start_cmd = 'cd %s && python3 test.py -G >>/dev/null '%(start_path)
os.system(start_cmd)
def get_cmds(args_list):
@ -380,7 +380,6 @@ Core dir: {core_dir}
'''
text_result=text.split("Result: ")[1].split("Details")[0].strip()
print(text_result)
if text_result == "success":
send_msg(notification_robot_url, get_msg(text))
else:

View File

@ -245,7 +245,7 @@ def start_taosd():
else:
pass
start_cmd = 'cd %s && python3 test.py '%(start_path)
start_cmd = 'cd %s && python3 test.py -G'%(start_path)
os.system(start_cmd +">>/dev/null")
def get_cmds(args_list):

View File

@ -236,7 +236,7 @@ def start_taosd():
else:
pass
start_cmd = 'cd %s && python3 test.py -N 4 -M 1 '%(start_path)
start_cmd = 'cd %s && python3 test.py -N 4 -M 1 -G '%(start_path)
os.system(start_cmd +">>/dev/null")
def get_cmds(args_list):

View File

@ -113,8 +113,9 @@ if __name__ == "__main__":
asan = False
independentMnode = False
previousCluster = False
opts, args = getopt.gnu_getopt(sys.argv[1:], 'f:p:m:l:scghrd:k:e:N:M:Q:C:RWD:n:i:aP', [
'file=', 'path=', 'master', 'logSql', 'stop', 'cluster', 'valgrind', 'help', 'restart', 'updateCfgDict', 'killv', 'execCmd','dnodeNums','mnodeNums','queryPolicy','createDnodeNums','restful','websocket','adaptercfgupdate','replicaVar','independentMnode','previous'])
crashGen = False
opts, args = getopt.gnu_getopt(sys.argv[1:], 'f:p:m:l:scghrd:k:e:N:M:Q:C:RWD:n:i:aP:G', [
'file=', 'path=', 'master', 'logSql', 'stop', 'cluster', 'valgrind', 'help', 'restart', 'updateCfgDict', 'killv', 'execCmd','dnodeNums','mnodeNums','queryPolicy','createDnodeNums','restful','websocket','adaptercfgupdate','replicaVar','independentMnode','previous',"crashGen"])
for key, value in opts:
if key in ['-h', '--help']:
tdLog.printNoPrefix(
@ -141,6 +142,7 @@ if __name__ == "__main__":
tdLog.printNoPrefix('-i independentMnode Mnode')
tdLog.printNoPrefix('-a address sanitizer mode')
tdLog.printNoPrefix('-P run case with [P]revious cluster, do not create new cluster to run case.')
tdLog.printNoPrefix('-G crashGen mode')
sys.exit(0)
@ -228,6 +230,10 @@ if __name__ == "__main__":
if key in ['-P', '--previous']:
previousCluster = True
if key in ['-G', '--crashGen']:
crashGen = True
#
# do exeCmd command
#
@ -692,6 +698,7 @@ if __name__ == "__main__":
# tdDnodes.StopAllSigint()
tdLog.info("Address sanitizer mode finished")
else:
if not crashGen:
tdDnodes.stopAll()
tdLog.info("stop all td process finished")
sys.exit(0)