test:add checking stream status and set interval 8 to test
This commit is contained in:
parent
9376d78b67
commit
e7b4fbcf90
|
@ -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,6 +1048,7 @@ 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,)] :
|
||||||
|
if check_wal_info:
|
||||||
for vgroup_num in range(vgroups):
|
for vgroup_num in range(vgroups):
|
||||||
if self.check_stream_wal_info(result_task_alll[vgroup_num][4]) :
|
if self.check_stream_wal_info(result_task_alll[vgroup_num][4]) :
|
||||||
check_stream_success += 1
|
check_stream_success += 1
|
||||||
|
@ -1055,6 +1056,8 @@ class TDCom:
|
||||||
else:
|
else:
|
||||||
check_stream_success = 0
|
check_stream_success = 0
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
|
check_stream_success = vgroups
|
||||||
|
|
||||||
if check_stream_success == vgroups:
|
if check_stream_success == vgroups:
|
||||||
break
|
break
|
||||||
|
|
|
@ -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,6 +621,7 @@ class TDTestCase:
|
||||||
)
|
)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
for fill_value in ["PREV", "NEXT", "VALUE"]:
|
||||||
self.force_window_close(
|
self.force_window_close(
|
||||||
interval=10,
|
interval=10,
|
||||||
partition="tbname",
|
partition="tbname",
|
||||||
|
@ -625,6 +629,15 @@ class TDTestCase:
|
||||||
funciton_name_alias="intp_c1",
|
funciton_name_alias="intp_c1",
|
||||||
delete=False,
|
delete=False,
|
||||||
ignore_update=1,
|
ignore_update=1,
|
||||||
|
fill_value=fill_value,
|
||||||
|
)
|
||||||
|
self.force_window_close(
|
||||||
|
interval=8,
|
||||||
|
partition="tbname",
|
||||||
|
funciton_name="interp(c1)",
|
||||||
|
funciton_name_alias="intp_c1",
|
||||||
|
delete=False,
|
||||||
|
ignore_update=1,
|
||||||
fill_value="PREV",
|
fill_value="PREV",
|
||||||
)
|
)
|
||||||
# self.force_window_close(interval=random.randint(10, 15), partition="c1", ignore_update=1)
|
# self.force_window_close(interval=random.randint(10, 15), partition="c1", ignore_update=1)
|
||||||
|
@ -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())
|
||||||
|
|
Loading…
Reference in New Issue