未验证 提交 95ba74f6 编写于 作者: W wade zhang 提交者: GitHub

Merge pull request #16809 from taosdata/3.0test/jcy

test:modify test case for TD-19062 (restart taosd after deleted data)
...@@ -81,6 +81,7 @@ class TDTestCase: ...@@ -81,6 +81,7 @@ class TDTestCase:
'binary':self.binary_val, 'binary':self.binary_val,
'nchar':self.nchar_val 'nchar':self.nchar_val
} }
def insert_base_data(self,col_type,tbname,rows,base_data): def insert_base_data(self,col_type,tbname,rows,base_data):
for i in range(rows): for i in range(rows):
if col_type.lower() == 'tinyint': if col_type.lower() == 'tinyint':
...@@ -290,6 +291,9 @@ class TDTestCase: ...@@ -290,6 +291,9 @@ class TDTestCase:
self.delete_data_ntb() self.delete_data_ntb()
self.delete_data_ctb() self.delete_data_ctb()
self.delete_data_stb() self.delete_data_stb()
tdDnodes.stoptaosd(1)
tdDnodes.starttaosd(1)
self.delete_data_ntb()
def stop(self): def stop(self):
tdSql.close() tdSql.close()
tdLog.success("%s successfully executed" % __file__) tdLog.success("%s successfully executed" % __file__)
......
...@@ -154,10 +154,12 @@ class TDTestCase: ...@@ -154,10 +154,12 @@ class TDTestCase:
up_bool = random.randint(0,100)%2 up_bool = random.randint(0,100)%2
up_float = random.uniform(constant.FLOAT_MIN,constant.FLOAT_MAX) up_float = random.uniform(constant.FLOAT_MIN,constant.FLOAT_MAX)
up_double = random.uniform(constant.DOUBLE_MIN*(1E-300),constant.DOUBLE_MAX*(1E-300)) up_double = random.uniform(constant.DOUBLE_MIN*(1E-300),constant.DOUBLE_MAX*(1E-300))
binary_length = random.randint(0,self.str_length) binary_length = []
nchar_length = random.randint(0,self.str_length) for i in range(self.str_length+1):
up_binary = tdCom.getLongName(binary_length) binary_length.append(i)
up_nchar = tdCom.getLongName(nchar_length) nchar_length = []
for i in range(self.str_length+1):
nchar_length.append(i)
for col_name,col_type in column_dict.items(): for col_name,col_type in column_dict.items():
if tb_type == 'ntb': if tb_type == 'ntb':
tdSql.execute(f'create table {tbname} (ts timestamp,{col_name} {col_type})') tdSql.execute(f'create table {tbname} (ts timestamp,{col_name} {col_type})')
...@@ -188,9 +190,13 @@ class TDTestCase: ...@@ -188,9 +190,13 @@ class TDTestCase:
elif col_type.lower() == 'double': elif col_type.lower() == 'double':
self.update_and_check_data(tbname,col_name,col_type,up_double,dbname) self.update_and_check_data(tbname,col_name,col_type,up_double,dbname)
elif 'binary' in col_type.lower(): elif 'binary' in col_type.lower():
self.update_and_check_data(tbname,col_name,col_type,up_binary,dbname) for i in binary_length:
up_binary = tdCom.getLongName(i)
self.update_and_check_data(tbname,col_name,col_type,up_binary,dbname)
elif 'nchar' in col_type.lower(): elif 'nchar' in col_type.lower():
self.update_and_check_data(tbname,col_name,col_type,up_nchar,dbname) for i in nchar_length:
up_nchar = tdCom.getLongName(i)
self.update_and_check_data(tbname,col_name,col_type,up_nchar,dbname)
elif col_type.lower() == 'timestamp': elif col_type.lower() == 'timestamp':
self.update_and_check_data(tbname,col_name,col_type,self.ts+1,dbname) self.update_and_check_data(tbname,col_name,col_type,self.ts+1,dbname)
tdSql.execute(f'insert into {tbname} values({self.ts},null)') tdSql.execute(f'insert into {tbname} values({self.ts},null)')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册