提交 76bf908f 编写于 作者: S Steven Li

Fixed TD-1430 for the crash_gen tool, ensuring no client side error for the test

上级 3ea060e1
...@@ -1763,7 +1763,7 @@ class TaskCreateDb(StateTransitionTask): ...@@ -1763,7 +1763,7 @@ class TaskCreateDb(StateTransitionTask):
return state.canCreateDb() return state.canCreateDb()
def _executeInternal(self, te: TaskExecutor, wt: WorkerThread): def _executeInternal(self, te: TaskExecutor, wt: WorkerThread):
self.execWtSql(wt, "create database db") self.execWtSql(wt, "create database db replica {}".format(Dice.throw(3)+1))
class TaskDropDb(StateTransitionTask): class TaskDropDb(StateTransitionTask):
...@@ -1832,7 +1832,7 @@ class TdSuperTable: ...@@ -1832,7 +1832,7 @@ class TdSuperTable:
return dbc.query("SELECT * FROM db.{}".format(self._stName)) > 0 return dbc.query("SELECT * FROM db.{}".format(self._stName)) > 0
def ensureTable(self, dbc: DbConn, regTableName: str): def ensureTable(self, dbc: DbConn, regTableName: str):
sql = "select tbname from {} where tbname in ('{}')".format(self._stName, regTableName) sql = "select tbname from db.{} where tbname in ('{}')".format(self._stName, regTableName)
if dbc.query(sql) >= 1 : # reg table exists already if dbc.query(sql) >= 1 : # reg table exists already
return return
sql = "CREATE TABLE {} USING {} tags ({})".format( sql = "CREATE TABLE {} USING {} tags ({})".format(
...@@ -1916,9 +1916,9 @@ class TaskReadData(StateTransitionTask): ...@@ -1916,9 +1916,9 @@ class TaskReadData(StateTransitionTask):
'max(speed)', 'max(speed)',
'first(speed)', 'first(speed)',
'last(speed)', 'last(speed)',
# 'top(speed)', # TODO: not supported? 'top(speed, 50)', # TODO: not supported?
# 'bottom(speed)', # TODO: not supported? 'bottom(speed, 50)', # TODO: not supported?
# 'percentile(speed, 10)', # TODO: TD-1316 'apercentile(speed, 10)', # TODO: TD-1316
'last_row(speed)', 'last_row(speed)',
# Transformation Functions # Transformation Functions
# 'diff(speed)', # TODO: no supported?! # 'diff(speed)', # TODO: no supported?!
...@@ -1928,7 +1928,9 @@ class TaskReadData(StateTransitionTask): ...@@ -1928,7 +1928,9 @@ class TaskReadData(StateTransitionTask):
None None
]) ])
try: try:
# Run the query against the regular table first
dbc.execute("select {} from db.{}".format(aggExpr, rTbName)) dbc.execute("select {} from db.{}".format(aggExpr, rTbName))
# Then run it against the super table
if aggExpr not in ['stddev(speed)']: #TODO: STDDEV not valid for super tables?! if aggExpr not in ['stddev(speed)']: #TODO: STDDEV not valid for super tables?!
dbc.execute("select {} from db.{}".format(aggExpr, sTable.getName())) dbc.execute("select {} from db.{}".format(aggExpr, sTable.getName()))
except taos.error.ProgrammingError as err: except taos.error.ProgrammingError as err:
...@@ -2022,7 +2024,7 @@ class TaskRestartService(StateTransitionTask): ...@@ -2022,7 +2024,7 @@ class TaskRestartService(StateTransitionTask):
return state.canDropFixedSuperTable() # Basicallly when we have the super table return state.canDropFixedSuperTable() # Basicallly when we have the super table
return False # don't run this otherwise return False # don't run this otherwise
CHANCE_TO_RESTART_SERVICE = 100 CHANCE_TO_RESTART_SERVICE = 200
def _executeInternal(self, te: TaskExecutor, wt: WorkerThread): def _executeInternal(self, te: TaskExecutor, wt: WorkerThread):
if not gConfig.auto_start_service: # only execute when we are in -a mode if not gConfig.auto_start_service: # only execute when we are in -a mode
print("_a", end="", flush=True) print("_a", end="", flush=True)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册