tweaked crash_gen tool

This commit is contained in:
Steven Li 2020-07-26 06:04:02 +00:00
parent 519a002511
commit 032d93b59a
1 changed files with 34 additions and 25 deletions

View File

@ -1192,6 +1192,7 @@ class StateMechine:
# case of multiple creation and drops
if self._curState.canDropDb():
if gSvcMgr == None: # only if we are not restarting service
self._curState.assertIfExistThenSuccess(tasks, TaskDropDb)
# self.assertAtMostOneSuccess(tasks, DropDbTask) # not really in
# case of drop-create-drop
@ -1366,8 +1367,10 @@ class TaskExecutor():
def __init__(self, size=10):
self._size = size
self._list = []
self._lock = threading.Lock()
def add(self, n: int):
with self._lock:
if not self._list: # empty
self._list.append(n)
return
@ -1497,6 +1500,9 @@ class Task():
return True
elif msg.find("duplicated column names") != -1: # also alter table tag issues
return True
elif (gSvcMgr!=None) and gSvcMgr.isRestarting():
logger.info("Ignoring error when service is restarting: errno = {}, msg = {}".format(errno, msg))
return True
return False # Not an acceptable error
@ -2196,7 +2202,7 @@ class SvcManager:
self.svcMgrThread = ServiceManagerThread() # create the object
self.svcMgrThread.start()
print("TAOS service started, printing out output...")
print("Attempting to start TAOS service started, printing out output...")
self.svcMgrThread.procIpcBatch(
trimToTarget=10,
forceOutput=True) # for printing 10 lines
@ -2397,6 +2403,9 @@ class ServiceManagerThread:
if self._status == MainExec.STATUS_STARTING: # we are starting, let's see if we have started
if line.find(self.TD_READY_MSG) != -1: # found
logger.info("Waiting for the service to become FULLY READY")
time.sleep(1.0) # wait for the server to truly start. TODO: remove this
logger.info("Service is now FULLY READY")
self._status = MainExec.STATUS_RUNNING
# Trim the queue if necessary: TODO: try this 1 out of 10 times