test:add checking stream status and set interval 8 to test

This commit is contained in:
chenhaoran 2024-10-30 21:33:54 +08:00 committed by 54liuyao
parent 9376d78b67
commit e7b4fbcf90
2 changed files with 34 additions and 17 deletions

View File

@ -1012,7 +1012,7 @@ class TDCom:
# If no match was found, or the pattern does not match the expected format, return False # If no match was found, or the pattern does not match the expected format, return False
return False return False
def check_stream_task_status(self, stream_name, vgroups, stream_timeout=None): def check_stream_task_status(self, stream_name, vgroups, stream_timeout=0, check_wal_info=True):
"""check stream status """check stream status
Args: Args:
@ -1048,13 +1048,16 @@ class TDCom:
print(f"result_task_status:{result_task_status},result_task_history:{result_task_history},result_task_alll:{result_task_alll}") print(f"result_task_status:{result_task_status},result_task_history:{result_task_history},result_task_alll:{result_task_alll}")
if result_task_status_rows == 1 and result_task_status ==[('ready',)] : if result_task_status_rows == 1 and result_task_status ==[('ready',)] :
if result_task_history_rows == 1 and result_task_history == [(None,)] : if result_task_history_rows == 1 and result_task_history == [(None,)] :
for vgroup_num in range(vgroups): if check_wal_info:
if self.check_stream_wal_info(result_task_alll[vgroup_num][4]) : for vgroup_num in range(vgroups):
check_stream_success += 1 if self.check_stream_wal_info(result_task_alll[vgroup_num][4]) :
tdLog.info(f"check stream task list[{check_stream_success}] sucessfully :") check_stream_success += 1
else: tdLog.info(f"check stream task list[{check_stream_success}] sucessfully :")
check_stream_success = 0 else:
break check_stream_success = 0
break
else:
check_stream_success = vgroups
if check_stream_success == vgroups: if check_stream_success == vgroups:
break break

View File

@ -126,7 +126,7 @@ class TDTestCase:
partition_elm = "" partition_elm = ""
if fill_value: if fill_value:
if "value" in fill_value.lower(): if "value" in fill_value.lower():
fill_value = "VALUE,1,2,3,4,5,6,7,8,9,10,11,1,2,3,4,5,6,7,8,9,10,11" fill_value = "VALUE,1"
# create error stream # create error stream
tdLog.info("create error stream") tdLog.info("create error stream")
@ -256,7 +256,7 @@ class TDTestCase:
if fill_value: if fill_value:
if "value" in fill_value.lower(): if "value" in fill_value.lower():
fill_value = "VALUE,1,2,3,4,5,6,7,8,9,10,11" fill_value = "VALUE,1"
# create stream general table # create stream general table
tdLog.info("create stream general table") tdLog.info("create stream general table")
@ -271,8 +271,15 @@ class TDTestCase:
ignore_update=ignore_update, ignore_update=ignore_update,
) )
#sleep 10s wait stream_task status is ready # wait and check stream_task status is ready
time.sleep(10) time.sleep(self.tdCom.dataDict["interval"])
tdSql.query("show streams")
tdLog.info(f"tdSql.queryResult:{tdSql.queryResult},tdSql.queryRows:{tdSql.queryRows}")
for stream_number in range(tdSql.queryRows):
stream_name = tdSql.queryResult[stream_number][0]
tdCom.check_stream_task_status(
stream_name=stream_name, vgroups=2, stream_timeout=20,check_wal_info=False
)
# insert data # insert data
self.tdCom.date_time = self.tdCom.genTs(precision=self.tdCom.precision)[0] self.tdCom.date_time = self.tdCom.genTs(precision=self.tdCom.precision)[0]
@ -487,8 +494,6 @@ class TDTestCase:
) )
start_new_ts = tdSql.getData(0, 1) start_new_ts = tdSql.getData(0, 1)
if tbname == self.ctb_name: if tbname == self.ctb_name:
if "value" in fill_value.lower():
fill_value = "VALUE,1,2,3,6,7,8,9,10,11,1,2,3,4,5,6,7,8,9,10,11"
if partition == "tbname": if partition == "tbname":
# check data for child table # check data for child table
tdLog.info("check data for child table ") tdLog.info("check data for child table ")
@ -536,8 +541,6 @@ class TDTestCase:
fill_value=fill_value, fill_value=fill_value,
) )
else: else:
if "value" in fill_value.lower():
fill_value = "VALUE,1"
if partition == "tbname": if partition == "tbname":
# check data for general table # check data for general table
self.tdCom.check_query_data( self.tdCom.check_query_data(
@ -618,8 +621,18 @@ class TDTestCase:
) )
def run(self): def run(self):
for fill_value in ["PREV", "NEXT", "VALUE"]:
self.force_window_close(
interval=10,
partition="tbname",
funciton_name="interp(c1)",
funciton_name_alias="intp_c1",
delete=False,
ignore_update=1,
fill_value=fill_value,
)
self.force_window_close( self.force_window_close(
interval=10, interval=8,
partition="tbname", partition="tbname",
funciton_name="interp(c1)", funciton_name="interp(c1)",
funciton_name_alias="intp_c1", funciton_name_alias="intp_c1",
@ -644,5 +657,6 @@ class TDTestCase:
event = threading.Event() event = threading.Event()
tdCases.addLinux(__file__, TDTestCase()) tdCases.addLinux(__file__, TDTestCase())
tdCases.addWindows(__file__, TDTestCase()) tdCases.addWindows(__file__, TDTestCase())