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

Minor tweak of crash_gen tool

上级 8eb30f62
...@@ -196,6 +196,7 @@ void walFsync(void *handle) { ...@@ -196,6 +196,7 @@ void walFsync(void *handle) {
if (pWal == NULL) return; if (pWal == NULL) return;
if (pWal->level == TAOS_WAL_FSYNC && pWal->fd >=0) { if (pWal->level == TAOS_WAL_FSYNC && pWal->fd >=0) {
printf("WAL-SYNC executed\n");
if (fsync(pWal->fd) < 0) { if (fsync(pWal->fd) < 0) {
wError("wal:%s, fsync failed(%s)", pWal->name, strerror(errno)); 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. # Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved. # All rights reserved.
...@@ -25,6 +25,7 @@ if sys.version_info[0] < 3: ...@@ -25,6 +25,7 @@ if sys.version_info[0] < 3:
import getopt import getopt
import argparse import argparse
import copy import copy
import requests
import threading import threading
import random import random
...@@ -1061,8 +1062,11 @@ class DbManager(): ...@@ -1061,8 +1062,11 @@ class DbManager():
def getNextTick(self): def getNextTick(self):
with self._lock: # prevent duplicate tick with self._lock: # prevent duplicate tick
self._lastTick += datetime.timedelta(0, 1) # add one second to it if Dice.throw(10) == 0 : # 1 in 10 chance
return self._lastTick 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): def getNextInt(self):
with self._lock: with self._lock:
...@@ -1220,7 +1224,12 @@ class Task(): ...@@ -1220,7 +1224,12 @@ class Task():
# sys.exit(-1) # sys.exit(-1)
self._err = err self._err = err
self._aborted = True 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)) self.logDebug("[=] Unexpected exception, SQL: {}".format(self._lastSql))
raise raise
self._execStats.endTaskType(self.__class__.__name__, self.isSuccess()) self._execStats.endTaskType(self.__class__.__name__, self.isSuccess())
...@@ -1699,6 +1708,8 @@ class ClientManager: ...@@ -1699,6 +1708,8 @@ class ClientManager:
dbc = dbManager.getDbConn() dbc = dbManager.getDbConn()
if dbc.query("show databases") == 0 : # no databae if dbc.query("show databases") == 0 : # no databae
return return
if dbc.query("show tables") == 0 : # no tables
return
dbc.execute("use db") dbc.execute("use db")
sTbName = dbManager.getFixedSuperTableName() sTbName = dbManager.getFixedSuperTableName()
......
...@@ -38,4 +38,4 @@ export PYTHONPATH=$(pwd)/../../src/connector/python/linux/python3 ...@@ -38,4 +38,4 @@ export PYTHONPATH=$(pwd)/../../src/connector/python/linux/python3
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/../../build/build/lib 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 # 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.
先完成此消息的编辑!
想要评论请 注册