提交 5c2b0097 编写于 作者: S Steven Li

Minor tweak of crash_gen tool

上级 8eb30f62
......@@ -196,6 +196,7 @@ void walFsync(void *handle) {
if (pWal == NULL) return;
if (pWal->level == TAOS_WAL_FSYNC && pWal->fd >=0) {
printf("WAL-SYNC executed\n");
if (fsync(pWal->fd) < 0) {
wError("wal:%s, fsync failed(%s)", pWal->name, strerror(errno));
}
......
#!/usr/bin/python3.7
#-----!/usr/bin/python3.7
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
......@@ -25,6 +25,7 @@ if sys.version_info[0] < 3:
import getopt
import argparse
import copy
import requests
import threading
import random
......@@ -1061,8 +1062,11 @@ class DbManager():
def getNextTick(self):
with self._lock: # prevent duplicate tick
self._lastTick += datetime.timedelta(0, 1) # add one second to it
return self._lastTick
if Dice.throw(10) == 0 : # 1 in 10 chance
return self._lastTick + datetime.timedelta(0, -100)
else: # regular
self._lastTick += datetime.timedelta(0, 1) # add one second to it
return self._lastTick
def getNextInt(self):
with self._lock:
......@@ -1220,7 +1224,12 @@ class Task():
# sys.exit(-1)
self._err = err
self._aborted = True
except:
except Exception as e :
self.logInfo("Non-TAOS exception encountered")
self._err = e
self._aborted = True
traceback.print_exc()
except :
self.logDebug("[=] Unexpected exception, SQL: {}".format(self._lastSql))
raise
self._execStats.endTaskType(self.__class__.__name__, self.isSuccess())
......@@ -1699,6 +1708,8 @@ class ClientManager:
dbc = dbManager.getDbConn()
if dbc.query("show databases") == 0 : # no databae
return
if dbc.query("show tables") == 0 : # no tables
return
dbc.execute("use db")
sTbName = dbManager.getFixedSuperTableName()
......
......@@ -38,4 +38,4 @@ export PYTHONPATH=$(pwd)/../../src/connector/python/linux/python3
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/../../build/build/lib
# Now we are all let, and let's see if we can find a crash. Note we pass all params
./crash_gen.py $@
python3 ./crash_gen.py $@
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册