Minor tweak of crash_gen tool

This commit is contained in:
Steven Li 2020-07-06 03:33:11 +00:00
parent 8eb30f62b1
commit 5c2b0097a7
3 changed files with 17 additions and 5 deletions

View File

@ -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));
}

View File

@ -1,4 +1,4 @@
#!/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()

View File

@ -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 $@