doc: add Chaos Test to README and update some functions
This commit is contained in:
parent
9cd1113c93
commit
008233ccf6
|
@ -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.
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue